* nsfns.m (ns_set_name, ns_set_name_as_filename): Don't call
authorChong Yidong <cyd@stupidchicken.com>
Sat, 24 Oct 2009 18:58:50 +0000 (18:58 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 24 Oct 2009 18:58:50 +0000 (18:58 +0000)
FRAME_NS_VIEW on terminal frames (Bug#4765).

src/ChangeLog
src/nsfns.m

index a30b658..9995421 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-24  Chong Yidong  <cyd@stupidchicken.com>
+
+       * nsfns.m (ns_set_name, ns_set_name_as_filename): Don't call
+       FRAME_NS_VIEW on terminal frames (Bug#4765).
+
 2009-10-24  Andreas Schwab  <schwab@linux-m68k.org>
 
        * dbusbind.c (xd_retrieve_arg): Handle DBUS_TYPE_INTnn and
index dbd4170..642ff79 100644 (file)
@@ -521,7 +521,7 @@ ns_set_name_iconic (struct frame *f, Lisp_Object name, int explicit)
 static void
 ns_set_name (struct frame *f, Lisp_Object name, int explicit)
 {
-  NSView *view = FRAME_NS_VIEW (f);
+  NSView *view;
   NSTRACE (ns_set_name);
 
   if (ns_in_resize)
@@ -552,6 +552,8 @@ ns_set_name (struct frame *f, Lisp_Object name, int explicit)
 
   CHECK_STRING (name);
 
+  view = FRAME_NS_VIEW (f);
+
   /* Don't change the name if it's already NAME.  */
   if ([[[view window] title]
             isEqualToString: [NSString stringWithUTF8String:
@@ -615,7 +617,7 @@ x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
 void
 ns_set_name_as_filename (struct frame *f)
 {
-  NSView *view = FRAME_NS_VIEW (f);
+  NSView *view;
   Lisp_Object name;
   Lisp_Object buf = XWINDOW (f->selected_window)->buffer;
   const char *title;
@@ -638,6 +640,8 @@ ns_set_name_as_filename (struct frame *f)
   else
     CHECK_STRING (name);
 
+  view = FRAME_NS_VIEW (f);
+
   title = FRAME_ICONIFIED_P (f) ? [[[view window] miniwindowTitle] UTF8String]
                                 : [[[view window] title] UTF8String];