#ifdef WINDOWSNT
#include "w32term.h"
#endif
-#ifdef macintosh
+#ifdef MAC_OS
#include "macterm.h"
#endif
#include "buffer.h"
Lisp_Object Vdefault_frame_alist;
Lisp_Object Vmouse_position_function;
Lisp_Object Vmouse_highlight;
+Lisp_Object Vdelete_frame_functions;
\f
static void
set_menu_bar_lines_1 (window, n)
buf = Fcurrent_buffer ();
/* If buf is a 'hidden' buffer (i.e. one whose name starts with
a space), try to find another one. */
- if (XSTRING (Fbuffer_name (buf))->data[0] == ' ')
+ if (SREF (Fbuffer_name (buf), 0) == ' ')
buf = Fother_buffer (buf, Qnil, Qnil);
/* Use set_window_buffer, not Fset_window_buffer, and don't let
f->output_method = output_termcap;
f->output_data.x = &tty_display;
#else
-#ifdef macintosh
+#ifdef MAC_OS8
make_mac_terminal_frame (f);
#else
f->output_data.x = &tty_display;
-#endif /* macintosh */
+#ifdef CANNOT_DUMP
+ FRAME_FOREGROUND_PIXEL(f) = FACE_TTY_DEFAULT_FG_COLOR;
+ FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR;
+#endif
+#endif /* MAC_OS8 */
#endif /* WINDOWSNT */
#endif /* MSDOS */
abort ();
#else /* not MSDOS */
-#ifdef macintosh
+#ifdef MAC_OS
if (sf->output_method != output_mac)
error ("Not running on a Macintosh screen; cannot make a new Macintosh frame");
#else
Normally, you may not delete a frame if all other frames are invisible,
but if the second optional argument FORCE is non-nil, you may do so.
-This function runs `delete-frame-hook' before actually deleting the
-frame. The hook is called with one argument FRAME. */)
+This function runs `delete-frame-functions' before actually deleting the
+frame, unless the frame is a tooltip.
+The functions are run with one arg, the frame to be deleted. */)
(frame, force)
Lisp_Object frame, force;
{
return Qnil;
if (NILP (force) && !other_visible_frames (f)
-#ifdef macintosh
+#ifdef MAC_OS8
/* Terminal frame deleted before any other visible frames are
created. */
- && strcmp (XSTRING (f->name)->data, "F1") != 0
+ && strcmp (SDATA (f->name), "F1") != 0
#endif
)
error ("Attempt to delete the sole visible or iconified frame");
}
}
- /* Run `delete-frame-hook'. */
- if (!NILP (Vrun_hooks))
+ /* Run `delete-frame-functions' unless frame is a tooltip. */
+ if (!NILP (Vrun_hooks)
+ && NILP (Fframe_parameter (frame, intern ("tooltip"))))
{
Lisp_Object args[2];
- args[0] = intern ("delete-frame-hook");
+ args[0] = intern ("delete-frame-functions");
args[1] = frame;
Frun_hook_with_args (2, args);
}
}
}
-/* Move BUFFER to the end of the buffer-list of each frame. */
-
-void
-frames_bury_buffer (buffer)
- Lisp_Object buffer;
-{
- Lisp_Object frame, tail;
-
- FOR_EACH_FRAME (tail, frame)
- {
- struct frame *f = XFRAME (frame);
- Lisp_Object found;
-
- found = Fmemq (buffer, f->buffer_list);
- if (!NILP (found))
- f->buffer_list = nconc2 (Fdelq (buffer, f->buffer_list),
- Fcons (buffer, Qnil));
- }
-}
-
/* Modify the alist in *ALISTPTR to associate PROP with VAL.
If the alist already has an element for PROP, we change it. */
/* Check for no change needed in this very common case
before we do any consing. */
- if (frame_name_fnn_p (XSTRING (f->name)->data,
- STRING_BYTES (XSTRING (f->name))))
+ if (frame_name_fnn_p (SDATA (f->name),
+ SBYTES (f->name)))
return;
terminal_frame_count++;
/* Don't allow the user to set the frame name to F<num>, so it
doesn't clash with the names we generate for terminal frames. */
- if (frame_name_fnn_p (XSTRING (name)->data, STRING_BYTES (XSTRING (name))))
+ if (frame_name_fnn_p (SDATA (name), SBYTES (name)))
error ("Frame names of the form F<num> are usurped by Emacs");
}
elt = Fassq (Qforeground_color, alist);
if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
{
- if (strncmp (XSTRING (XCDR (elt))->data,
+ if (strncmp (SDATA (XCDR (elt)),
unspecified_bg,
- XSTRING (XCDR (elt))->size) == 0)
+ SCHARS (XCDR (elt))) == 0)
store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg));
- else if (strncmp (XSTRING (XCDR (elt))->data,
+ else if (strncmp (SDATA (XCDR (elt)),
unspecified_fg,
- XSTRING (XCDR (elt))->size) == 0)
+ SCHARS (XCDR (elt))) == 0)
store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg));
}
else
elt = Fassq (Qbackground_color, alist);
if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt)))
{
- if (strncmp (XSTRING (XCDR (elt))->data,
+ if (strncmp (SDATA (XCDR (elt)),
unspecified_fg,
- XSTRING (XCDR (elt))->size) == 0)
+ SCHARS (XCDR (elt))) == 0)
store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg));
- else if (strncmp (XSTRING (XCDR (elt))->data,
+ else if (strncmp (SDATA (XCDR (elt)),
unspecified_bg,
- XSTRING (XCDR (elt))->size) == 0)
+ SCHARS (XCDR (elt))) == 0)
store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg));
}
else
"unspecified". We need to do the same here. */
if (STRINGP (value) && !FRAME_WINDOW_P (f))
{
- char *color_name;
+ const char *color_name;
EMACS_INT csz;
if (EQ (parameter, Qbackground_color))
{
- color_name = XSTRING (value)->data;
- csz = XSTRING (value)->size;
+ color_name = SDATA (value);
+ csz = SCHARS (value);
if (strncmp (color_name, unspecified_bg, csz) == 0)
value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f));
else if (strncmp (color_name, unspecified_fg, csz) == 0)
}
else if (EQ (parameter, Qforeground_color))
{
- color_name = XSTRING (value)->data;
- csz = XSTRING (value)->size;
+ color_name = SDATA (value);
+ csz = SCHARS (value);
if (strncmp (color_name, unspecified_fg, csz) == 0)
value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f));
else if (strncmp (color_name, unspecified_bg, csz) == 0)
{
FRAME_PTR f;
register Lisp_Object tail, prop, val;
- int count = BINDING_STACK_SIZE ();
+ int count = SPECPDL_INDEX ();
/* Bind this to t to inhibit initialization of the default face from
X resources in face-set-after-frame-default. If we don't inhibit
when the mouse is over clickable text. */);
Vmouse_highlight = Qt;
+ DEFVAR_LISP ("delete-frame-functions", &Vdelete_frame_functions,
+ doc: /* Functions to be run before deleting a frame.
+The functions are run with one arg, the frame to be deleted.
+See `delete-frame'. */);
+ Vdelete_frame_functions = Qnil;
+
DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
doc: /* Minibufferless frames use this frame's minibuffer.