#define MAXPATHLEN 1024
#endif /* not MAXPATHLEN */
-#include "config.h"
+#include <config.h>
#include "lisp.h"
#include "intervals.h"
#include "window.h"
CHECK_STRING (name, 0);
tem = Fget_buffer (name);
- if (XBUFFER (tem) == current_buffer)
+ /* Don't short-circuit if UNIQUE is t. That is a useful way to rename
+ the buffer automatically so you can create another with the original name.
+ It makes UNIQUE equivalent to
+ (rename-buffer (generate-new-buffer-name NAME)). */
+ if (NILP (unique) && XBUFFER (tem) == current_buffer)
return current_buffer->name;
if (!NILP (tem))
{
\f
DEFUN ("erase-buffer", Ferase_buffer, Serase_buffer, 0, 0, "*",
"Delete the entire contents of the current buffer.\n\
-Any clipping restriction in effect (see `narrow-to-region') is removed,\n\
+Any narrowing restriction in effect (see `narrow-to-region') is removed,\n\
so the buffer is truly empty after this.")
()
{
{
Lisp_Object desired_point;
- desired_point =
- internal_with_output_to_temp_buffer ("*Buffer List*",
- list_buffers_1, files);
+ desired_point
+ = internal_with_output_to_temp_buffer ("*Buffer List*",
+ list_buffers_1, files);
if (NUMBERP (desired_point))
{
SET_PT (XINT (desired_point));
return unbind_to (count, Qnil);
}
+ return Qnil;
}
DEFUN ("kill-all-local-variables", Fkill_all_local_variables, Skill_all_local_variables,
b->overlays_after = Fdelq (overlay, b->overlays_after);
redisplay_region (b,
- OVERLAY_POSITION (OVERLAY_START (overlay)),
- OVERLAY_POSITION (OVERLAY_END (overlay)));
+ marker_position (OVERLAY_START (overlay)),
+ marker_position (OVERLAY_END (overlay)));
Fset_marker (OVERLAY_START (overlay), Qnil, Qnil);
Fset_marker (OVERLAY_END (overlay), Qnil, Qnil);
CHECK_OVERLAY (overlay, 0);
- redisplay_region (XMARKER (OVERLAY_START (overlay))->buffer,
- OVERLAY_POSITION (OVERLAY_START (overlay)),
- OVERLAY_POSITION (OVERLAY_END (overlay)));
+ tail = Fmarker_buffer (OVERLAY_START (overlay));
+ if (! NILP (tail))
+ redisplay_region (XMARKER (OVERLAY_START (overlay))->buffer,
+ marker_position (OVERLAY_START (overlay)),
+ marker_position (OVERLAY_END (overlay)));
plist = Fcdr_safe (XCONS (overlay)->cdr);