const struct tm *, int);
#ifdef WINDOWSNT
-extern Lisp_Object w32_get_internal_run_time ();
+extern Lisp_Object w32_get_internal_run_time (void);
#endif
static int tm_diff (struct tm *, struct tm *);
-static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *);
+static void find_field (Lisp_Object, Lisp_Object, Lisp_Object,
+ EMACS_INT *, Lisp_Object, EMACS_INT *);
static void update_buffer_properties (int, int);
static Lisp_Object region_limit (int);
-int lisp_time_argument (Lisp_Object, time_t *, int *);
static size_t emacs_memftimeu (char *, size_t, const char *,
size_t, const struct tm *, int);
static void general_insert_function (void (*) (const unsigned char *, EMACS_INT),
static Lisp_Object subst_char_in_region_unwind_1 (Lisp_Object);
static void transpose_markers (int, int, int, int, int, int, int, int);
-#ifdef HAVE_INDEX
-extern char *index (const char *, int);
-#endif
-
Lisp_Object Vbuffer_access_fontify_functions;
Lisp_Object Qbuffer_access_fontify_functions;
Lisp_Object Vbuffer_access_fontified_property;
DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0,
doc: /* Convert arg CHAR to a string containing that character.
usage: (char-to-string CHAR) */)
- (character)
- Lisp_Object character;
+ (Lisp_Object character)
{
int len;
unsigned char str[MAX_MULTIBYTE_LENGTH];
DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
doc: /* Convert arg BYTE to a string containing that byte. */)
- (byte)
- Lisp_Object byte;
+ (Lisp_Object byte)
{
unsigned char b;
CHECK_NUMBER (byte);
DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0,
doc: /* Convert arg STRING to a character, the first character of that string.
A multibyte character is handled correctly. */)
- (string)
- register Lisp_Object string;
+ (register Lisp_Object string)
{
register Lisp_Object val;
CHECK_STRING (string);
DEFUN ("point", Fpoint, Spoint, 0, 0, 0,
doc: /* Return value of point, as an integer.
Beginning of buffer is position (point-min). */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, PT);
DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0,
doc: /* Return value of point, as a marker object. */)
- ()
+ (void)
{
return buildmark (PT, PT_BYTE);
}
Beginning of buffer is position (point-min), end is (point-max).
The return value is POSITION. */)
- (position)
- register Lisp_Object position;
+ (register Lisp_Object position)
{
int pos;
static Lisp_Object
region_limit (int beginningp)
{
- extern Lisp_Object Vmark_even_if_inactive; /* Defined in callint.c. */
Lisp_Object m;
if (!NILP (Vtransient_mark_mode)
}
DEFUN ("region-beginning", Fregion_beginning, Sregion_beginning, 0, 0, 0,
- doc: /* Return position of beginning of region, as an integer. */)
- ()
+ doc: /* Return the integer value of point or mark, whichever is smaller. */)
+ (void)
{
return region_limit (1);
}
DEFUN ("region-end", Fregion_end, Sregion_end, 0, 0, 0,
- doc: /* Return position of end of region, as an integer. */)
- ()
+ doc: /* Return the integer value of point or mark, whichever is larger. */)
+ (void)
{
return region_limit (0);
}
doc: /* Return this buffer's mark, as a marker object.
Watch out! Moving this marker changes the mark position.
If you set the marker not to point anywhere, the buffer will have no mark. */)
- ()
+ (void)
{
return current_buffer->mark;
}
is not stored. */
static void
-find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, Lisp_Object beg_limit, int *beg, Lisp_Object end_limit, int *end)
+find_field (Lisp_Object pos, Lisp_Object merge_at_boundary,
+ Lisp_Object beg_limit,
+ EMACS_INT *beg, Lisp_Object end_limit, EMACS_INT *end)
{
/* Fields right before and after the point. */
Lisp_Object before_field, after_field;
doc: /* Delete the field surrounding POS.
A field is a region of text with the same `field' property.
If POS is nil, the value of point is used for POS. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
- int beg, end;
+ EMACS_INT beg, end;
find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
if (beg != end)
del_range (beg, end);
doc: /* Return the contents of the field surrounding POS as a string.
A field is a region of text with the same `field' property.
If POS is nil, the value of point is used for POS. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
- int beg, end;
+ EMACS_INT beg, end;
find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
return make_buffer_string (beg, end, 1);
}
doc: /* Return the contents of the field around POS, without text properties.
A field is a region of text with the same `field' property.
If POS is nil, the value of point is used for POS. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
- int beg, end;
+ EMACS_INT beg, end;
find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
return make_buffer_string (beg, end, 0);
}
field, then the beginning of the *previous* field is returned.
If LIMIT is non-nil, it is a buffer position; if the beginning of the field
is before LIMIT, then LIMIT will be returned instead. */)
- (pos, escape_from_edge, limit)
- Lisp_Object pos, escape_from_edge, limit;
+ (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit)
{
- int beg;
+ EMACS_INT beg;
find_field (pos, escape_from_edge, limit, &beg, Qnil, 0);
return make_number (beg);
}
then the end of the *following* field is returned.
If LIMIT is non-nil, it is a buffer position; if the end of the field
is after LIMIT, then LIMIT will be returned instead. */)
- (pos, escape_from_edge, limit)
- Lisp_Object pos, escape_from_edge, limit;
+ (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit)
{
- int end;
+ EMACS_INT end;
find_field (pos, escape_from_edge, Qnil, 0, limit, &end);
return make_number (end);
}
a non-nil property of that name, then any field boundaries are ignored.
Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */)
- (new_pos, old_pos, escape_from_edge, only_in_line, inhibit_capture_property)
- Lisp_Object new_pos, old_pos;
- Lisp_Object escape_from_edge, only_in_line, inhibit_capture_property;
+ (Lisp_Object new_pos, Lisp_Object old_pos, Lisp_Object escape_from_edge, Lisp_Object only_in_line, Lisp_Object inhibit_capture_property)
{
/* If non-zero, then the original point, before re-positioning. */
int orig_point = 0;
With argument N not nil or 1, move forward N - 1 lines first.
If scan reaches end of buffer, return that position.
+The returned position is of the first character in the logical order,
+i.e. the one that has the smallest character position.
+
This function constrains the returned position to the current field
unless that would be on a different line than the original,
unconstrained result. If N is nil or 1, and a front-sticky field
boundaries bind `inhibit-field-text-motion' to t.
This function does not move point. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
int orig, orig_byte, end;
int count = SPECPDL_INDEX ();
With argument N not nil or 1, move forward N - 1 lines first.
If scan reaches end of buffer, return that position.
+The returned position is of the last character in the logical order,
+i.e. the character whose buffer position is the largest one.
+
This function constrains the returned position to the current field
unless that would be on a different line than the original,
unconstrained result. If N is nil or 1, and a rear-sticky field ends
boundaries bind `inhibit-field-text-motion' to t.
This function does not move point. */)
- (n)
- Lisp_Object n;
+ (Lisp_Object n)
{
int end_pos;
int orig = PT;
then just use `save-current-buffer', or even `with-current-buffer'.
usage: (save-excursion &rest BODY) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
register Lisp_Object val;
int count = SPECPDL_INDEX ();
doc: /* Save the current buffer; execute BODY; restore the current buffer.
Executes BODY just like `progn'.
usage: (save-current-buffer &rest BODY) */)
- (args)
- Lisp_Object args;
+ (Lisp_Object args)
{
Lisp_Object val;
int count = SPECPDL_INDEX ();
DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0,
doc: /* Return the number of characters in the current buffer.
If BUFFER, return the number of characters in that buffer instead. */)
- (buffer)
- Lisp_Object buffer;
+ (Lisp_Object buffer)
{
if (NILP (buffer))
return make_number (Z - BEG);
DEFUN ("point-min", Fpoint_min, Spoint_min, 0, 0, 0,
doc: /* Return the minimum permissible value of point in the current buffer.
This is 1, unless narrowing (a buffer restriction) is in effect. */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, BEGV);
DEFUN ("point-min-marker", Fpoint_min_marker, Spoint_min_marker, 0, 0, 0,
doc: /* Return a marker to the minimum permissible value of point in this buffer.
This is the beginning, unless narrowing (a buffer restriction) is in effect. */)
- ()
+ (void)
{
return buildmark (BEGV, BEGV_BYTE);
}
doc: /* Return the maximum permissible value of point in the current buffer.
This is (1+ (buffer-size)), unless narrowing (a buffer restriction)
is in effect, in which case it is less. */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, ZV);
doc: /* Return a marker to the maximum permissible value of point in this buffer.
This is (1+ (buffer-size)), unless narrowing (a buffer restriction)
is in effect, in which case it is less. */)
- ()
+ (void)
{
return buildmark (ZV, ZV_BYTE);
}
DEFUN ("gap-position", Fgap_position, Sgap_position, 0, 0, 0,
doc: /* Return the position of the gap, in the current buffer.
See also `gap-size'. */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, GPT);
DEFUN ("gap-size", Fgap_size, Sgap_size, 0, 0, 0,
doc: /* Return the size of the current buffer's gap.
See also `gap-position'. */)
- ()
+ (void)
{
Lisp_Object temp;
XSETFASTINT (temp, GAP_SIZE);
DEFUN ("position-bytes", Fposition_bytes, Sposition_bytes, 1, 1, 0,
doc: /* Return the byte position for character position POSITION.
If POSITION is out of range, the value is nil. */)
- (position)
- Lisp_Object position;
+ (Lisp_Object position)
{
CHECK_NUMBER_COERCE_MARKER (position);
if (XINT (position) < BEG || XINT (position) > Z)
DEFUN ("byte-to-position", Fbyte_to_position, Sbyte_to_position, 1, 1, 0,
doc: /* Return the character position for byte position BYTEPOS.
If BYTEPOS is out of range, the value is nil. */)
- (bytepos)
- Lisp_Object bytepos;
+ (Lisp_Object bytepos)
{
CHECK_NUMBER (bytepos);
if (XINT (bytepos) < BEG_BYTE || XINT (bytepos) > Z_BYTE)
DEFUN ("following-char", Ffollowing_char, Sfollowing_char, 0, 0, 0,
doc: /* Return the character following point, as a number.
At the end of the buffer or accessible region, return 0. */)
- ()
+ (void)
{
Lisp_Object temp;
if (PT >= ZV)
DEFUN ("preceding-char", Fprevious_char, Sprevious_char, 0, 0, 0,
doc: /* Return the character preceding point, as a number.
At the beginning of the buffer or accessible region, return 0. */)
- ()
+ (void)
{
Lisp_Object temp;
if (PT <= BEGV)
DEFUN ("bobp", Fbobp, Sbobp, 0, 0, 0,
doc: /* Return t if point is at the beginning of the buffer.
If the buffer is narrowed, this means the beginning of the narrowed part. */)
- ()
+ (void)
{
if (PT == BEGV)
return Qt;
DEFUN ("eobp", Feobp, Seobp, 0, 0, 0,
doc: /* Return t if point is at the end of the buffer.
If the buffer is narrowed, this means the end of the narrowed part. */)
- ()
+ (void)
{
if (PT == ZV)
return Qt;
DEFUN ("bolp", Fbolp, Sbolp, 0, 0, 0,
doc: /* Return t if point is at the beginning of a line. */)
- ()
+ (void)
{
if (PT == BEGV || FETCH_BYTE (PT_BYTE - 1) == '\n')
return Qt;
DEFUN ("eolp", Feolp, Seolp, 0, 0, 0,
doc: /* Return t if point is at the end of a line.
`End of a line' includes point being at the end of the buffer. */)
- ()
+ (void)
{
if (PT == ZV || FETCH_BYTE (PT_BYTE) == '\n')
return Qt;
doc: /* Return character in current buffer at position POS.
POS is an integer or a marker and defaults to point.
If POS is out of range, the value is nil. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
register int pos_byte;
doc: /* Return character in current buffer preceding position POS.
POS is an integer or a marker and defaults to point.
If POS is out of range, the value is nil. */)
- (pos)
- Lisp_Object pos;
+ (Lisp_Object pos)
{
register Lisp_Object val;
register int pos_byte;
If optional argument UID is an integer or a float, return the login name
of the user with that uid, or nil if there is no such user. */)
- (uid)
- Lisp_Object uid;
+ (Lisp_Object uid)
{
struct passwd *pw;
uid_t id;
doc: /* Return the name of the user's real uid, as a string.
This ignores the environment variables LOGNAME and USER, so it differs from
`user-login-name' when running under `su'. */)
- ()
+ (void)
{
/* Set up the user name info if we didn't do it before.
(That can happen if Emacs is dumpable
DEFUN ("user-uid", Fuser_uid, Suser_uid, 0, 0, 0,
doc: /* Return the effective uid of Emacs.
Value is an integer or a float, depending on the value. */)
- ()
+ (void)
{
/* Assignment to EMACS_INT stops GCC whining about limited range of
data type. */
DEFUN ("user-real-uid", Fuser_real_uid, Suser_real_uid, 0, 0, 0,
doc: /* Return the real uid of Emacs.
Value is an integer or a float, depending on the value. */)
- ()
+ (void)
{
/* Assignment to EMACS_INT stops GCC whining about limited range of
data type. */
of the user with that uid, or nil if there is no such user.
If UID is a string, return the full name of the user with that login
name, or nil if there is no such user. */)
- (uid)
- Lisp_Object uid;
+ (Lisp_Object uid)
{
struct passwd *pw;
register unsigned char *p, *q;
p = (unsigned char *) USER_FULL_NAME;
/* Chop off everything after the first comma. */
- q = (unsigned char *) index (p, ',');
+ q = (unsigned char *) strchr (p, ',');
full = make_string (p, q ? q - p : strlen (p));
#ifdef AMPERSAND_FULL_NAME
p = SDATA (full);
- q = (unsigned char *) index (p, '&');
+ q = (unsigned char *) strchr (p, '&');
/* Substitute the login name for the &, upcasing the first character. */
if (q)
{
DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
doc: /* Return the host name of the machine you are running on, as a string. */)
- ()
+ (void)
{
return Vsystem_name;
}
/* For the benefit of callers who don't want to include lisp.h */
-char *
+const char *
get_system_name (void)
{
if (STRINGP (Vsystem_name))
- return (char *) SDATA (Vsystem_name);
+ return (const char *) SDATA (Vsystem_name);
else
return "";
}
-char *
+const char *
get_operating_system_release (void)
{
if (STRINGP (Voperating_system_release))
DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
doc: /* Return the process ID of Emacs, as an integer. */)
- ()
+ (void)
{
return make_number (getpid ());
}
The microsecond count is zero on systems that do not provide
resolution finer than a second. */)
- ()
+ (void)
{
EMACS_TIME t;
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. */)
- ()
+ (void)
{
#ifdef HAVE_GETRUSAGE
struct rusage usage;
WARNING: Since the result is floating point, it may not be exact.
If precise time stamps are required, use either `current-time',
or (if you need time as a string) `format-time-string'. */)
- (specified_time)
- Lisp_Object specified_time;
+ (Lisp_Object specified_time)
{
time_t sec;
int usec;
%OX is like %X, but uses the locale's number symbols.
For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */)
- (format_string, time, universal)
- Lisp_Object format_string, time, universal;
+ (Lisp_Object format_string, Lisp_Object time, Lisp_Object universal)
{
time_t value;
int size;
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.) */)
- (specified_time)
- Lisp_Object specified_time;
+ (Lisp_Object specified_time)
{
time_t time_spec;
struct tm save_tm;
year values as low as 1901 do work.
usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
time_t time;
struct tm tm;
else
{
char tzbuf[100];
- char *tzstring;
+ const char *tzstring;
char **oldenv = environ, **newenv;
if (EQ (zone, Qt))
Thus, you can use times obtained from `current-time' and from
`file-attributes'. SPECIFIED-TIME can also have the form (HIGH . LOW),
but this is considered obsolete. */)
- (specified_time)
- Lisp_Object specified_time;
+ (Lisp_Object specified_time)
{
time_t value;
struct tm *tm;
Some operating systems cannot provide all this information to Emacs;
in this case, `current-time-zone' returns a list containing nil for
the data it can't find. */)
- (specified_time)
- Lisp_Object specified_time;
+ (Lisp_Object specified_time)
{
time_t value;
struct tm *t;
doc: /* Set the local time zone using TZ, a string specifying a time zone rule.
If TZ is nil, use implementation-defined default time zone information.
If TZ is t, use Universal Time. */)
- (tz)
- Lisp_Object tz;
+ (Lisp_Object tz)
{
- char *tzstring;
+ const char *tzstring;
/* When called for the first time, save the original TZ. */
if (!environbuf)
responsibility to free. */
void
-set_time_zone_rule (char *tzstring)
+set_time_zone_rule (const char *tzstring)
{
int envptrs;
char **from, **to, **newenv;
and insert the result.
usage: (insert &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
general_insert_function (insert, insert_from_string, 0, nargs, args);
return Qnil;
to unibyte for insertion.
usage: (insert-and-inherit &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
general_insert_function (insert_and_inherit, insert_from_string, 1,
nargs, args);
to unibyte for insertion.
usage: (insert-before-markers &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
general_insert_function (insert_before_markers,
insert_from_string_before_markers, 0,
to unibyte for insertion.
usage: (insert-before-markers-and-inherit &rest ARGS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
general_insert_function (insert_before_markers_and_inherit,
insert_from_string_before_markers, 1,
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. */)
- (character, count, inherit)
- Lisp_Object character, count, inherit;
+ (Lisp_Object character, Lisp_Object count, Lisp_Object inherit)
{
register unsigned char *string;
register int strlen;
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. */)
- (byte, count, inherit)
- Lisp_Object byte, count, inherit;
+ (Lisp_Object byte, Lisp_Object count, Lisp_Object inherit)
{
CHECK_NUMBER (byte);
if (XINT (byte) < 0 || XINT (byte) > 255)
buffer substrings. */
Lisp_Object
-make_buffer_string (int start, int end, int props)
+make_buffer_string (EMACS_INT start, EMACS_INT end, int props)
{
- int start_byte = CHAR_TO_BYTE (start);
- int end_byte = CHAR_TO_BYTE (end);
+ EMACS_INT start_byte = CHAR_TO_BYTE (start);
+ EMACS_INT end_byte = CHAR_TO_BYTE (end);
return make_buffer_string_both (start, start_byte, end, end_byte, props);
}
buffer substrings. */
Lisp_Object
-make_buffer_string_both (int start, int start_byte, int end, int end_byte, int props)
+make_buffer_string_both (EMACS_INT start, EMACS_INT start_byte,
+ EMACS_INT end, EMACS_INT end_byte, int props)
{
Lisp_Object result, tem, tem1;
This function copies the text properties of that part of the buffer
into the result string; if you don't want the text properties,
use `buffer-substring-no-properties' instead. */)
- (start, end)
- Lisp_Object start, end;
+ (Lisp_Object start, Lisp_Object end)
{
- register int b, e;
+ register EMACS_INT b, e;
validate_region (&start, &end);
b = XINT (start);
doc: /* Return the characters of part of the buffer, without the text properties.
The two arguments START and END are character positions;
they can be in either order. */)
- (start, end)
- Lisp_Object start, end;
+ (Lisp_Object start, Lisp_Object end)
{
- register int b, e;
+ register EMACS_INT b, e;
validate_region (&start, &end);
b = XINT (start);
doc: /* Return the contents of the current buffer as a string.
If narrowing is in effect, this function returns only the visible part
of the buffer. */)
- ()
+ (void)
{
return make_buffer_string (BEGV, ZV, 1);
}
BUFFER may be a buffer or a buffer name.
Arguments START and END are character positions specifying the substring.
They default to the values of (point-min) and (point-max) in BUFFER. */)
- (buffer, start, end)
- Lisp_Object buffer, start, end;
+ (Lisp_Object buffer, Lisp_Object start, Lisp_Object end)
{
register int b, e, temp;
register struct buffer *bp, *obuf;
The value of `case-fold-search' in the current buffer
determines whether case is significant or ignored. */)
- (buffer1, start1, end1, buffer2, start2, end2)
- Lisp_Object buffer1, start1, end1, buffer2, start2, end2;
+ (Lisp_Object buffer1, Lisp_Object start1, Lisp_Object end1, Lisp_Object buffer2, Lisp_Object start2, Lisp_Object end2)
{
register int begp1, endp1, begp2, endp2, temp;
register struct buffer *bp1, *bp2;
If optional arg NOUNDO is non-nil, don't record this change for undo
and don't mark the buffer as really changed.
Both characters must have the same length of multi-byte form. */)
- (start, end, fromchar, tochar, noundo)
- Lisp_Object start, end, fromchar, tochar, noundo;
+ (Lisp_Object start, Lisp_Object end, Lisp_Object fromchar, Lisp_Object tochar, Lisp_Object noundo)
{
register int pos, pos_byte, stop, i, len, end_byte;
/* Keep track of the first change in the buffer:
TABLE is a string or a char-table; the Nth character in it is the
mapping for the character with code N.
It returns the number of characters changed. */)
- (start, end, table)
- Lisp_Object start;
- Lisp_Object end;
- register Lisp_Object table;
+ (Lisp_Object start, Lisp_Object end, register Lisp_Object table)
{
register unsigned char *tt; /* Trans table. */
register int nc; /* New character. */
When called from a program, expects two arguments,
positions (integers or markers) specifying the stretch to be deleted. */)
- (start, end)
- Lisp_Object start, end;
+ (Lisp_Object start, Lisp_Object end)
{
validate_region (&start, &end);
del_range (XINT (start), XINT (end));
DEFUN ("delete-and-extract-region", Fdelete_and_extract_region,
Sdelete_and_extract_region, 2, 2, 0,
doc: /* Delete the text between START and END and return it. */)
- (start, end)
- Lisp_Object start, end;
+ (Lisp_Object start, Lisp_Object end)
{
validate_region (&start, &end);
if (XINT (start) == XINT (end))
DEFUN ("widen", Fwiden, Swiden, 0, 0, "",
doc: /* Remove restrictions (narrowing) from current buffer.
This allows the buffer's full text to be seen and edited. */)
- ()
+ (void)
{
if (BEG != BEGV || Z != ZV)
current_buffer->clip_changed = 1;
When calling from a program, pass two arguments; positions (integers
or markers) bounding the text that should remain visible. */)
- (start, end)
- register Lisp_Object start, end;
+ (register Lisp_Object start, Lisp_Object end)
{
CHECK_NUMBER_COERCE_MARKER (start);
CHECK_NUMBER_COERCE_MARKER (end);
(save-excursion (save-restriction ...))
usage: (save-restriction &rest BODY) */)
- (body)
- Lisp_Object body;
+ (Lisp_Object body)
{
register Lisp_Object val;
int count = SPECPDL_INDEX ();
also `current-message'.
usage: (message FORMAT-STRING &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
if (NILP (args[0])
|| (STRINGP (args[0])
message; let the minibuffer contents show.
usage: (message-box FORMAT-STRING &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
if (NILP (args[0]))
{
return val;
}
}
-#ifdef HAVE_MENUS
-extern Lisp_Object last_nonmenu_event;
-#endif
DEFUN ("message-or-box", Fmessage_or_box, Smessage_or_box, 1, MANY, 0,
doc: /* Display a message in a dialog box or in the echo area.
message; let the minibuffer contents show.
usage: (message-or-box FORMAT-STRING &rest ARGS) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
#ifdef HAVE_MENUS
if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
DEFUN ("current-message", Fcurrent_message, Scurrent_message, 0, 0, 0,
doc: /* Return the string currently displayed in the echo area, or nil if none. */)
- ()
+ (void)
{
return current_message ();
}
Remaining arguments form a sequence of PROPERTY VALUE pairs for text
properties to add to the result.
usage: (propertize STRING &rest PROPERTIES) */)
- (nargs, args)
- int nargs;
- Lisp_Object *args;
+ (int nargs, Lisp_Object *args)
{
Lisp_Object properties, string;
struct gcpro gcpro1, gcpro2;
specifier truncates the string to the given width.
usage: (format STRING &rest OBJECTS) */)
- (nargs, args)
- int nargs;
- register Lisp_Object *args;
+ (int nargs, register Lisp_Object *args)
{
register int n; /* The number of the next arg to substitute */
register int total; /* An estimate of the final length */
int multibyte = 0;
/* When we make a multibyte string, we must pay attention to the
byte combining problem, i.e., a byte may be combined with a
- multibyte charcter of the previous string. This flag tells if we
+ multibyte character of the previous string. This flag tells if we
must consider such a situation or not. */
int maybe_combine_byte;
unsigned char *this_format;
discarded[format - format_start] = 1;
format++;
- while (index ("-+0# ", *format))
+ while (strchr ("-+0# ", *format))
{
if (*format == '-')
{
}
Lisp_Object
-format2 (char *string1, Lisp_Object arg0, Lisp_Object arg1)
+format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1)
{
Lisp_Object args[3];
args[0] = build_string (string1);
doc: /* Return t if two characters match, optionally ignoring case.
Both arguments must be characters (i.e. integers).
Case is ignored if `case-fold-search' is non-nil in the current buffer. */)
- (c1, c2)
- register Lisp_Object c1, c2;
+ (register Lisp_Object c1, Lisp_Object c2)
{
int i1, i2;
/* Check they're chars, not just integers, otherwise we could get array
It's the caller's job to ensure that START1 <= END1 <= START2 <= END2. */
static void
-transpose_markers (start1, end1, start2, end2,
- start1_byte, end1_byte, start2_byte, end2_byte)
- register int start1, end1, start2, end2;
- register int start1_byte, end1_byte, start2_byte, end2_byte;
+transpose_markers (int start1, int end1, int start2, int end2,
+ int start1_byte, int end1_byte,
+ int start2_byte, int end2_byte)
{
register int amt1, amt1_byte, amt2, amt2_byte, diff, diff_byte, mpos;
register struct Lisp_Marker *marker;
any markers that happen to be located in the regions.
Transposing beyond buffer boundaries is an error. */)
- (startr1, endr1, startr2, endr2, leave_markers)
- Lisp_Object startr1, endr1, startr2, endr2, leave_markers;
+ (Lisp_Object startr1, Lisp_Object endr1, Lisp_Object startr2, Lisp_Object endr2, Lisp_Object leave_markers)
{
register EMACS_INT start1, end1, start2, end2;
EMACS_INT start1_byte, start2_byte, len1_byte, len2_byte;
{
Lisp_Object obuf;
- extern Lisp_Object Vprin1_to_string_buffer;
obuf = Fcurrent_buffer ();
/* Do this here, because init_buffer_once is too early--it won't work. */
Fset_buffer (Vprin1_to_string_buffer);