/* Code for doing intervals.
- Copyright (C) 1993-1995, 1997-1998, 2001-2015 Free Software
+ Copyright (C) 1993-1995, 1997-1998, 2001-2016 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.
+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
#include <intprops.h>
#include "lisp.h"
#include "intervals.h"
-#include "character.h"
#include "buffer.h"
#include "puresize.h"
-#include "keyboard.h"
#include "keymap.h"
/* Test for membership, allowing for t (actually any non-cons) to mean the
{
INTERVAL new;
- CHECK_IMPURE (parent);
-
new = make_interval ();
- if (BUFFERP (parent))
+ if (! STRINGP (parent))
{
new->total_length = (BUF_Z (XBUFFER (parent))
- BUF_BEG (XBUFFER (parent)));
set_buffer_intervals (XBUFFER (parent), new);
new->position = BEG;
}
- else if (STRINGP (parent))
+ else
{
+ CHECK_IMPURE (parent, XSTRING (parent));
new->total_length = SCHARS (parent);
eassert (TOTAL_LENGTH (new) >= 0);
set_string_intervals (parent, new);
new->position = 0;
}
eassert (LENGTH (new) > 0);
-
+
set_interval_object (new, parent);
return new;