emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r99699: Clean up unneeded ns_set_i


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r99699: Clean up unneeded ns_set_icon_type calls.
Date: Mon, 29 Mar 2010 19:48:44 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99699
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Mon 2010-03-29 19:48:44 -0400
message:
  Clean up unneeded ns_set_icon_type calls.
  
  Patch from Adrian Robert, see
  http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01391.html
  
  * xdisp.c (x_consider_frame_title, update_window_cursor): Remove
  HAVE_NS conditionals.
  (prepare_menu_bars)[HAVE_NS]: Call ns_set_doc_edited.
  
  * nsfns.m (x_implicitly_set_name): If frame-title-format is t, use
  filename for the title.
  (ns_set_doc_edited): Do nothing if the selected window is a
  minibuffer window.
  
  * nsterm.h: Add prototypes for ns_set_name_as_filename and
  ns_set_doc_edited.
  
  * nsterm.m: Remove unneeded prototype.
modified:
  src/ChangeLog
  src/nsfns.m
  src/nsterm.h
  src/nsterm.m
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-03-28 18:55:20 +0000
+++ b/src/ChangeLog     2010-03-29 23:48:44 +0000
@@ -1,3 +1,19 @@
+2010-03-29  Adrian Robert  <address@hidden>
+
+       * xdisp.c (x_consider_frame_title, update_window_cursor): Remove
+       HAVE_NS conditionals.
+       (prepare_menu_bars)[HAVE_NS]: Call ns_set_doc_edited.
+
+       * nsfns.m (x_implicitly_set_name): If frame-title-format is t, use
+       filename for the title.
+       (ns_set_doc_edited): Do nothing if the selected window is a
+       minibuffer window.
+
+       * nsterm.h: Add prototypes for ns_set_name_as_filename and
+       ns_set_doc_edited.
+
+       * nsterm.m: Remove unneeded prototype.
+
 2010-03-28  Glenn Morris  <address@hidden>
 
        * Makefile.in (SOME_MACHINE_OBJECTS): Ensure dbus stuff is always

=== modified file 'src/nsfns.m'
--- a/src/nsfns.m       2010-01-15 01:46:53 +0000
+++ b/src/nsfns.m       2010-03-29 23:48:44 +0000
@@ -81,6 +81,7 @@
 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
 extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle;
 extern Lisp_Object Qnone;
+extern Lisp_Object Vframe_title_format;
 
 Lisp_Object Qbuffered;
 Lisp_Object Qfontsize;
@@ -583,6 +584,8 @@
   NSTRACE (x_implicitly_set_name);
   if (FRAME_ICONIFIED_P (f))
     ns_set_name_iconic (f, arg, 0);
+  else if (FRAME_NS_P (f) && EQ (Vframe_title_format, Qt))
+    ns_set_name_as_filename (f);
   else
     ns_set_name (f, arg, 0);
 }
@@ -627,14 +630,14 @@
 
   BLOCK_INPUT;
   pool = [[NSAutoreleasePool alloc] init];
-  name =XBUFFER (buf)->filename;
+  name = XBUFFER (buf)->filename;
   if (NILP (name) || FRAME_ICONIFIED_P (f)) name =XBUFFER (buf)->name;
 
   if (FRAME_ICONIFIED_P (f) && !NILP (f->icon_name))
     name = f->icon_name;
 
   if (NILP (name))
-    name = build_string([ns_app_name UTF8String]);
+    name = build_string ([ns_app_name UTF8String]);
   else
     CHECK_STRING (name);
 
@@ -687,11 +690,14 @@
 {
   NSView *view = FRAME_NS_VIEW (f);
   NSAutoreleasePool *pool;
-  BLOCK_INPUT;
-  pool = [[NSAutoreleasePool alloc] init];
-  [[view window] setDocumentEdited: !NILP (arg)];
-  [pool release];
-  UNBLOCK_INPUT;
+  if (!MINI_WINDOW_P (XWINDOW (f->selected_window)))
+    {
+      BLOCK_INPUT;
+      pool = [[NSAutoreleasePool alloc] init];
+      [[view window] setDocumentEdited: !NILP (arg)];
+      [pool release];
+      UNBLOCK_INPUT;
+    }
 }
 
 

=== modified file 'src/nsterm.h'
--- a/src/nsterm.h      2010-01-13 08:35:10 +0000
+++ b/src/nsterm.h      2010-03-29 23:48:44 +0000
@@ -708,6 +708,8 @@
 extern int ns_lisp_to_cursor_type ();
 extern Lisp_Object ns_cursor_type_to_lisp (int arg);
 extern Lisp_Object Qnone;
+extern void ns_set_name_as_filename (struct frame *f);
+extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg);
 
 extern int
 ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc,

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2010-02-18 07:21:15 +0000
+++ b/src/nsterm.m      2010-03-29 23:48:44 +0000
@@ -4173,8 +4173,6 @@
   ns_send_appdefined (-2);
 }
 
-extern void update_window_cursor (struct window *w, int on);
-
 - (void)fd_handler: (NSTimer *) fdEntry
 /* --------------------------------------------------------------------------
      Check data waiting on file descriptors and terminate if so

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2010-03-24 21:25:46 +0000
+++ b/src/xdisp.c       2010-03-29 23:48:44 +0000
@@ -9472,32 +9472,7 @@
       if (! STRINGP (f->name)
          || SBYTES (f->name) != len
          || bcmp (title, SDATA (f->name), len) != 0)
-        {
-#ifdef HAVE_NS
-          if (FRAME_NS_P (f))
-            {
-              if (!MINI_WINDOW_P(XWINDOW(f->selected_window)))
-                {
-                  if (EQ (fmt, Qt))
-                    ns_set_name_as_filename (f);
-                  else
-                    x_implicitly_set_name (f, make_string(title, len),
-                                           Qnil);
-                }
-            }
-          else
-#endif
-           x_implicitly_set_name (f, make_string (title, len), Qnil);
-        }
-#ifdef HAVE_NS
-      if (FRAME_NS_P (f))
-        {
-          /* do this also for frames with explicit names */
-          ns_implicitly_set_icon_type(f);
-          ns_set_doc_edited(f, Fbuffer_modified_p
-                            (XWINDOW (f->selected_window)->buffer), Qnil);
-        }
-#endif
+       x_implicitly_set_name (f, make_string (title, len), Qnil);
     }
 }
 
@@ -9594,6 +9569,11 @@
 #ifdef HAVE_WINDOW_SYSTEM
          update_tool_bar (f, 0);
 #endif
+#ifdef HAVE_NS
+          if (windows_or_buffers_changed)
+            ns_set_doc_edited (f, Fbuffer_modified_p
+                              (XWINDOW (f->selected_window)->buffer));
+#endif
          UNGCPRO;
        }
 
@@ -22653,9 +22633,6 @@
 /* Switch the display of W's cursor on or off, according to the value
    of ON.  */
 
-#ifndef HAVE_NS
-static
-#endif
 void
 update_window_cursor (w, on)
      struct window *w;


reply via email to

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