changeset: 4520:d883854f988d8346295cb43195bc4c8f9f71072e
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Sun Aug 03 13:13:47 2008 +0200
files: lisp/ChangeLog lisp/carbon-init.el src/ChangeLog src/device-carbon.c
src/redisplay.c
description:
Call general device-type code at first device creation, not startup, Carbon.
src/ChangeLog addition:
2008-08-03 Aidan Kehoe <kehoea(a)parhasard.net>
* device-carbon.c: (Qmake_device_early_carbon_entry_point,
Qmake_device_late_carbon_entry_point): Add these two new symbols,
following the approach used in the other device code.
(carbon_init_device): Call
#'make-device-early-carbon-entry-point.
(carbon_finish_init_device): Call
#'make-device-late-carbon-entry-point.
* redisplay.c (init_redisplay): Set initial-device-type, not
initial-window-system here.
lisp/ChangeLog addition:
2008-08-03 Aidan Kehoe <kehoea(a)parhasard.net>
* carbon-init.el: Add copyright information. Use the
#'make-device-early-carbon-entry-point,
#'make-device-late-carbon-entry-point approach the other console
code now uses. Document the latter function, alias the former to
#'ignore, since there's nothing for it to do right now.
diff -r 20604b71c40bbf752a83a96834da80a74cb62046 -r
d883854f988d8346295cb43195bc4c8f9f71072e lisp/ChangeLog
--- a/lisp/ChangeLog Sun Aug 03 12:23:13 2008 +0200
+++ b/lisp/ChangeLog Sun Aug 03 13:13:47 2008 +0200
@@ -1,3 +1,11 @@ 2008-07-26 Aidan Kehoe <kehoea@parhasa
+2008-08-03 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * carbon-init.el: Add copyright information. Use the
+ #'make-device-early-carbon-entry-point,
+ #'make-device-late-carbon-entry-point approach the other console
+ code now uses. Document the latter function, alias the former to
+ #'ignore, since there's nothing for it to do right now.
+
2008-07-26 Aidan Kehoe <kehoea(a)parhasard.net>
* x-init.el (x-initialize-compose):
diff -r 20604b71c40bbf752a83a96834da80a74cb62046 -r
d883854f988d8346295cb43195bc4c8f9f71072e lisp/carbon-init.el
--- a/lisp/carbon-init.el Sun Aug 03 12:23:13 2008 +0200
+++ b/lisp/carbon-init.el Sun Aug 03 13:13:47 2008 +0200
@@ -1,27 +1,56 @@
-(defvar carbon-win-initted nil)
-(defvar carbon-pre-win-initted nil)
-(defvar carbon-post-win-initted nil)
+;;; carbon-init.el --- initialization code for Carbon
-(defun init-pre-carbon-win ()
- "Initialize Carbon GUI at startup (pre). Don't call this."
- (unless carbon-pre-win-initted
- (setq carbon-pre-win-initted t)))
+;; Copyright (C) 2008 Free Software Foundation, Inc.
-(defun init-carbon-win ()
- "Initialize carbon GUI at startup. Don't call this."
- (unless carbon-win-initted
- (init-pre-carbon-win)
- (make-carbon-device)
- (init-post-carbon-win (selected-console))
+;; Originally written by Andrew Choi, his work was placed in the public
+;; domain in 2005. Further work by Aidan Kehoe, assigned to the Free Sofware
+;; Foundation under the GPL.
+
+;; Maintainer: XEmacs Development Team
+;; Keywords: terminals, dumped
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License along
+;; with XEmacs; see the file COPYING. If not, see
+;; <
http://www.gnu.org/licenses/>;.
+
+;;; Synched up with: Not in GNU Emacs.
+
+;;; Commentary:
+
+;; This file is dumped with XEmacs (when X support is compiled in).
+
+;;; Code:
+
+;; No need to have this do anything for now.
+(defalias 'make-device-early-carbon-entry-point #'ignore)
+
+;; This is useful, though.
+(defvar make-device-late-carbon-entry-point-called-p nil
+ "Whether `make-device-late-carbon-entry-point' has been called, at least
once.
+
+Under Carbon, when XEmacs is started from the Finder, the initial directory
+is `/'; this is inappropriate for XEmacs, and we change to the user's home
+directory on startup.")
+
+(defun make-device-late-carbon-entry-point (device)
+ "Entry point to do any Lisp-level Carbon device-specific initialization."
+ (unless make-device-late-carbon-entry-point-called-p
;; If Emacs is started from the Finder, change the default directory
;; to the user's home directory.
(if (string= default-directory "/")
(cd "~"))
+ (setq make-device-late-carbon-entry-point-called-p t)))
- (setq carbon-win-initted t)))
-
-(defun init-post-carbon-win (console)
- "Initialize carbon GUI at startup (post). Don't call this."
- (unless carbon-post-win-initted
- (setq carbon-post-win-initted t)))
diff -r 20604b71c40bbf752a83a96834da80a74cb62046 -r
d883854f988d8346295cb43195bc4c8f9f71072e src/ChangeLog
--- a/src/ChangeLog Sun Aug 03 12:23:13 2008 +0200
+++ b/src/ChangeLog Sun Aug 03 13:13:47 2008 +0200
@@ -1,3 +1,15 @@ 2008-07-20 John Paul Wallington <jpw@p
+2008-08-03 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * device-carbon.c: (Qmake_device_early_carbon_entry_point,
+ Qmake_device_late_carbon_entry_point): Add these two new symbols,
+ following the approach used in the other device code.
+ (carbon_init_device): Call
+ #'make-device-early-carbon-entry-point.
+ (carbon_finish_init_device): Call
+ #'make-device-late-carbon-entry-point.
+ * redisplay.c (init_redisplay): Set initial-device-type, not
+ initial-window-system here.
+
2008-07-20 John Paul Wallington <jpw(a)pobox.com>
* nt.c (Fmswindows_short_file_name, Fmswindows_long_file_name):
diff -r 20604b71c40bbf752a83a96834da80a74cb62046 -r
d883854f988d8346295cb43195bc4c8f9f71072e src/device-carbon.c
--- a/src/device-carbon.c Sun Aug 03 12:23:13 2008 +0200
+++ b/src/device-carbon.c Sun Aug 03 13:13:47 2008 +0200
@@ -25,6 +25,9 @@
#include "console-carbon-impl.h"
+Lisp_Object Qmake_device_early_carbon_entry_point,
+ Qmake_device_late_carbon_entry_point;
+
static void
check_app_is_bundled (void)
{
@@ -48,6 +51,9 @@ carbon_init_device (struct device *d, Li
DEVICE_CARBON_DATA (d) = xnew_and_zero (struct carbon_device);
+ /* Run the elisp side of the carbon device initialization. */
+ call0 (Qmake_device_early_carbon_entry_point);
+
DEVICE_CARBON_COLOR_SPACE (d) = CGColorSpaceCreateDeviceRGB ();
/* Without this, isearch, for instance, will think it's running on
@@ -61,8 +67,9 @@ carbon_init_device (struct device *d, Li
}
static void
-carbon_finish_init_device(struct device * UNUSED (d), Lisp_Object UNUSED (props))
+carbon_finish_init_device(struct device * d, Lisp_Object UNUSED (props))
{
+ call1 (Qmake_device_late_carbon_entry_point, wrap_device (d));
}
static void
@@ -97,6 +104,8 @@ void
void
syms_of_device_carbon (void)
{
+ DEFSYMBOL (Qmake_device_early_carbon_entry_point);
+ DEFSYMBOL (Qmake_device_late_carbon_entry_point);
}
void
diff -r 20604b71c40bbf752a83a96834da80a74cb62046 -r
d883854f988d8346295cb43195bc4c8f9f71072e src/redisplay.c
--- a/src/redisplay.c Sun Aug 03 12:23:13 2008 +0200
+++ b/src/redisplay.c Sun Aug 03 13:13:47 2008 +0200
@@ -9799,7 +9799,7 @@ init_redisplay (void)
{
/* Some stuff checks this way early. */
Vwindow_system = Qcarbon;
- Vinitial_window_system = Qcarbon;
+ Vinitial_device_type = Qcarbon;
return;
}
#endif /* HAVE_MS_WINDOWS */
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches