def get_text(self): end = lisp.buffer_size() + 1 old_min = lisp.point_min() old_max = lisp.point_max() narrowed = (old_min != 1 or old_max != end) if narrowed: lisp.narrow_to_region(1, lisp.buffer_size() + 1) try: return lisp.buffer_string() finally: if narrowed: lisp.narrow_to_region(old_min, old_max)
def _get_text(self): if not lisp.buffer_modified_p(): return self._get_resource().read() end = lisp.buffer_size() + 1 old_min = lisp.point_min() old_max = lisp.point_max() narrowed = (old_min != 1 or old_max != end) if narrowed: lisp.narrow_to_region(1, lisp.buffer_size() + 1) try: return lisp.buffer_string() finally: if narrowed: lisp.narrow_to_region(old_min, old_max)