emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117637: * nsfns.m (ns_set_doc_edited): Do all lo


From: Jan D.
Subject: [Emacs-diffs] emacs-24 r117637: * nsfns.m (ns_set_doc_edited): Do all logic (check frames) here
Date: Thu, 30 Oct 2014 19:15:44 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117637
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/18884
committer: Jan D. <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-10-30 20:15:38 +0100
message:
  * nsfns.m (ns_set_doc_edited): Do all logic (check frames) here
  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).
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/nsfns.m                    nsfns.m-20091113204419-o5vbwnq5f7feedwu-8741
  src/nsterm.h                   nsterm.h-20091113204419-o5vbwnq5f7feedwu-8746
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-10-30 17:23:52 +0000
+++ b/src/ChangeLog     2014-10-30 19:15:38 +0000
@@ -1,5 +1,13 @@
 2014-10-30  Jan Djärv  <address@hidden>
 
+       * 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.

=== modified file 'src/nsfns.m'
--- a/src/nsfns.m       2014-10-30 17:23:52 +0000
+++ b/src/nsfns.m       2014-10-30 19:15:38 +0000
@@ -631,18 +631,26 @@
 
 
 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 ();
 }
 
 

=== modified file 'src/nsterm.h'
--- a/src/nsterm.h      2014-10-30 17:23:52 +0000
+++ b/src/nsterm.h      2014-10-30 19:15:38 +0000
@@ -818,7 +818,7 @@
 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,

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2014-10-22 01:39:48 +0000
+++ b/src/xdisp.c       2014-10-30 19:15:38 +0000
@@ -11779,12 +11779,6 @@
 #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;
        }
 
@@ -14149,6 +14143,9 @@
 #endif /* HAVE_WINDOW_SYSTEM */
 
  end_of_redisplay:
+#ifdef HAVE_NS
+  ns_set_doc_edited ();
+#endif
   if (interrupt_input && interrupts_deferred)
     request_sigio ();
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]