instead of in xdisp.c, function now takes void.
* nsterm.h (ns_set_doc_edited): Declare taking no args.
* xdisp.c (prepare_menu_bars): Remove HAVE_NS code.
(redisplay_internal): Call ns_set_doc_edited if HAVE_NS (Bug#18884).
2014-10-30 Jan Djärv <jan.h.d@swipnet.se>
+ * nsterm.h (ns_set_doc_edited): Declare taking no args.
+
+ * nsfns.m (ns_set_doc_edited): Do all logic (check frames) here
+ instead of in xdisp.c, function now takes void. (Bug#18884).
+
+ * xdisp.c (prepare_menu_bars): Remove HAVE_NS code.
+ (redisplay_internal): Call ns_set_doc_edited if HAVE_NS (Bug#18884).
+
* nsterm.h (EmacsScroller): Replace Lisp_Object win with
struct window* (Bug#18889).
Remove getMouseMotionPart.
void
-ns_set_doc_edited (struct frame *f, Lisp_Object arg)
+ns_set_doc_edited (void)
{
- NSView *view = FRAME_NS_VIEW (f);
NSAutoreleasePool *pool;
- if (!MINI_WINDOW_P (XWINDOW (f->selected_window)))
+ Lisp_Object tail, frame;
+ block_input ();
+ pool = [[NSAutoreleasePool alloc] init];
+ FOR_EACH_FRAME (tail, frame)
{
- block_input ();
- pool = [[NSAutoreleasePool alloc] init];
- [[view window] setDocumentEdited: !NILP (arg)];
- [pool release];
- unblock_input ();
+ BOOL edited = NO;
+ struct frame *f = XFRAME (frame);
+ struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
+ NSView *view = FRAME_NS_VIEW (f);
+ if (!MINI_WINDOW_P (w))
+ edited = ! NILP (Fbuffer_modified_p (w->contents)) &&
+ ! NILP (Fbuffer_file_name (w->contents));
+ [[view window] setDocumentEdited: edited];
}
+
+ [pool release];
+ unblock_input ();
}
extern int ns_lisp_to_cursor_type (Lisp_Object arg);
extern Lisp_Object ns_cursor_type_to_lisp (int arg);
extern void ns_set_name_as_filename (struct frame *f);
-extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg);
+extern void ns_set_doc_edited (void);
extern bool
ns_defined_color (struct frame *f,
menu_bar_hooks_run = update_menu_bar (f, 0, menu_bar_hooks_run);
#ifdef HAVE_WINDOW_SYSTEM
update_tool_bar (f, 0);
-#endif
-#ifdef HAVE_NS
- if (windows_or_buffers_changed
- && FRAME_NS_P (f))
- ns_set_doc_edited
- (f, Fbuffer_modified_p (XWINDOW (f->selected_window)->contents));
#endif
UNGCPRO;
}
#endif /* HAVE_WINDOW_SYSTEM */
end_of_redisplay:
+#ifdef HAVE_NS
+ ns_set_doc_edited ();
+#endif
if (interrupt_input && interrupts_deferred)
request_sigio ();