changeset 99028:713fc3ab99e5

* lisp/version.el (emacs-version): Change '*Step' to 'NS' for consistency with other documentation. * src/nsfns.m (ns_appkit_version): New function. (x-server-version): Use it. (syms_of_nsfns): Define ns-version-string here, not nsterm.m. (x-server-vendor): Don't check_ns(). * nsterm.m (syms_of_nsterm): Drop ns-version-string.
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Wed, 22 Oct 2008 12:51:29 +0000
parents 1cd7efcfe063
children da79c29252c4
files lisp/ChangeLog lisp/version.el src/ChangeLog src/nsfns.m src/nsterm.m
diffstat 5 files changed, 50 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Oct 22 11:26:24 2008 +0000
+++ b/lisp/ChangeLog	Wed Oct 22 12:51:29 2008 +0000
@@ -1,3 +1,8 @@
+2008-10-22  Adrian Robert  <Adrian.B.Robert@gmail.com>
+
+	* version.el (emacs-version): Change '*Step' to 'NS' for consistency
+	with other documentation.
+
 2008-10-22  Juanma Barranquero  <lekktu@gmail.com>
 
 	* replace.el (how-many): Fix typo in docstring.
--- a/lisp/version.el	Wed Oct 22 11:26:24 2008 +0000
+++ b/lisp/version.el	Wed Oct 22 12:51:29 2008 +0000
@@ -66,7 +66,7 @@
 			(concat ", GTK+ Version " gtk-version-string))
 		       ((featurep 'x-toolkit) ", X toolkit")
 		       ((featurep 'ns)
-			(format ", *Step %s" ns-version-string))
+			(format ", NS %s" ns-version-string))
 		       (t ""))
 		 (if (and (boundp 'x-toolkit-scroll-bars)
 			  (memq x-toolkit-scroll-bars '(xaw xaw3d)))
--- a/src/ChangeLog	Wed Oct 22 11:26:24 2008 +0000
+++ b/src/ChangeLog	Wed Oct 22 12:51:29 2008 +0000
@@ -1,3 +1,12 @@
+2008-10-02  Adrian Robert  <Adrian.B.Robert@gmail.com>
+
+	* nsfns.m (ns_appkit_version): New function.
+	(x-server-version): Use it.
+	(syms_of_nsfns): Define ns-version-string here, not nsterm.m.
+	(x-server-vendor): Don't check_ns().
+
+	* nsterm.m (syms_of_nsterm): Drop ns-version-string.
+
 2008-10-22  Juanma Barranquero  <lekktu@gmail.com>
 
 	* w32fns.c (unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
--- a/src/nsfns.m	Wed Oct 22 11:26:24 2008 +0000
+++ b/src/nsfns.m	Wed Oct 22 12:51:29 2008 +0000
@@ -86,7 +86,10 @@
 
 /* Alist of elements (REGEXP . IMAGE) for images of icons associated
    to frames.*/
-Lisp_Object Vns_icon_type_alist;
+static Lisp_Object Vns_icon_type_alist;
+
+/* Toolkit version support. */
+static Lisp_Object Vns_version_string;
 
 EmacsTooltip *ns_tooltip;
 
@@ -950,6 +953,25 @@
 }
 
 
+#define Str(x) #x
+#define Xstr(x) Str(x)
+
+static Lisp_Object
+ns_appkit_version ()
+{
+  char tmp[80];
+
+#ifdef NS_IMPL_GNUSTEP
+  sprintf(tmp, "gnustep-gui-%s", Xstr(GNUSTEP_GUI_VERSION));
+#elif defined(NS_IMPL_COCOA)
+  sprintf(tmp, "apple-appkit-%.2f", NSAppKitVersionNumber);
+#else
+  tmp = "ns-unknown";
+#endif
+  return build_string (tmp);
+}
+
+
 static void
 x_icon (struct frame *f, Lisp_Object parms)
 /* --------------------------------------------------------------------------
@@ -1019,6 +1041,13 @@
 };
 
 
+
+/* ==========================================================================
+
+    Lisp definitions
+
+   ========================================================================== */
+
 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
        1, 1, 0,
        doc: /* Make a new Nextstep window, called a \"frame\" in Emacs terms.
@@ -1321,12 +1350,6 @@
 }
 
 
-/* ==========================================================================
-
-    Lisp definitions
-
-   ========================================================================== */
-
 DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
        doc: /* Set the input focus to FRAME.
 FRAME nil means use the selected frame.  */)
@@ -1575,7 +1598,6 @@
      (display)
      Lisp_Object display;
 {
-  check_ns ();
 #ifdef NS_IMPL_GNUSTEP
   return build_string ("GNU");
 #else
@@ -1592,8 +1614,7 @@
      (display)
      Lisp_Object display;
 {
-  /* FIXME: return GUI version on GNUstep, ?? on OS X */
-  return build_string ("1.0");
+  return ns_appkit_version ();
 }
 
 
@@ -2640,6 +2661,10 @@
 be used as the image of the icon representing the frame.  */);
   Vns_icon_type_alist = Fcons (Qt, Qnil);
 
+  DEFVAR_LISP ("ns-version-string", &Vns_version_string,
+               doc: /* Toolkit version for NS Windowing.  */);
+  Vns_version_string = ns_appkit_version ();
+
   defsubr (&Sns_read_file_name);
   defsubr (&Sns_get_resource);
   defsubr (&Sns_set_resource);
--- a/src/nsterm.m	Wed Oct 22 11:26:24 2008 +0000
+++ b/src/nsterm.m	Wed Oct 22 12:51:29 2008 +0000
@@ -6379,13 +6379,6 @@
 
   /* Tell emacs about this window system. */
   Fprovide (intern ("ns"), Qnil);
-  /* TODO: try to move this back into lisp,  ns-win.el loaded too late
-           right now */
-  {
-    Lisp_Object args[3] = { intern ("ns-version-string"), build_string ("9.0"),
-                    build_string ("NS Window system port version number.") };
-    Fdefconst (Flist (3, args));
-  }
 }