From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ted Lemon Newsgroups: gmane.emacs.devel Subject: Patch to get Emacs to work on MacOS 10.3 (Panther) Date: Sun, 2 Nov 2003 18:33:47 -0600 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <636D6972-0D95-11D8-A8A6-000A95D9C74C@fugue.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v606) Content-Type: multipart/mixed; boundary=Apple-Mail-1--681885490 X-Trace: sea.gmane.org 1067823543 26295 80.91.224.253 (3 Nov 2003 01:39:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2003 01:39:03 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Nov 03 02:39:01 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AGTgL-0000t4-00 for ; Mon, 03 Nov 2003 02:39:01 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AGTgK-00021f-00 for ; Mon, 03 Nov 2003 02:39:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AGTcJ-0000Ka-7Y for emacs-devel@quimby.gnus.org; Sun, 02 Nov 2003 20:34:51 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AGSg2-0002HK-Nc for emacs-devel@gnu.org; Sun, 02 Nov 2003 19:34:38 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AGSfL-0001wi-AK for emacs-devel@gnu.org; Sun, 02 Nov 2003 19:34:26 -0500 Original-Received: from [204.152.186.142] (helo=toccata.fugue.com) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AGSfJ-0001uH-6y for emacs-devel@gnu.org; Sun, 02 Nov 2003 19:33:53 -0500 Original-Received: from [10.0.1.4] (dsl093-187-232.chi2.dsl.speakeasy.net [66.93.187.232]) by toccata.fugue.com (Postfix) with ESMTP id D7DDE1B2259 for ; Sun, 2 Nov 2003 18:28:09 -0600 (CST) Original-To: emacs-devel@gnu.org X-Mailer: Apple Mail (2.606) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17659 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17659 --Apple-Mail-1--681885490 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed I get the feeling that this may come as a surprise to some other users of Emacs on Panther, but I have been unable to get it to come up as a Carbon app, although it runs find with -nw. Near as I can figure, for some reason the Carbon framework is having trouble finding the window resources in Emacs.app/Contents/Resources/Emacs.rsrc, even though ktrace shows it opening the file and reading it just before it dumps core. It turns out that at least on MacOS X, there is no particular reason to use the Emacs.rsrc file in the first place, and I think this may be true of MacOS 8.5 and MacOS 9 as well. Instead of calling GetNewCWindow(), which takes a resource ID, one can just call CreateNewWindow(). With this, Emacs starts up just fine for me. I am not sufficiently familiar with MacOS classic issues to say that this patch should be applied as is, but I present it for your edification, since it solved my problem, and if it does make sense to include it, of course I would appreciate that. --Apple-Mail-1--681885490 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="foo" Content-Disposition: attachment; filename=foo Index: src/macterm.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/macterm.c,v retrieving revision 1.51 diff -c -r1.51 macterm.c *** src/macterm.c 1 Nov 2003 19:58:03 -0000 1.51 --- src/macterm.c 3 Nov 2003 00:22:55 -0000 *************** *** 8218,8241 **** NewMacWindow (FRAME_PTR fp) { mac_output *mwp; #if TARGET_API_MAC_CARBON static int making_terminal_window = 0; #else static int making_terminal_window = 1; #endif mwp = fp->output_data.mac; if (making_terminal_window) { ! if (!(mwp->mWP = GetNewCWindow (TERM_WINDOW_RESOURCE, NULL, ! (WindowPtr) -1))) abort (); making_terminal_window = 0; } else ! if (!(mwp->mWP = GetNewCWindow (WINDOW_RESOURCE, NULL, (WindowPtr) -1))) ! abort (); SetWRefCon (mwp->mWP, (long) mwp); /* so that update events can find this mac_output struct */ --- 8218,8248 ---- NewMacWindow (FRAME_PTR fp) { mac_output *mwp; + OSStatus status; #if TARGET_API_MAC_CARBON static int making_terminal_window = 0; #else static int making_terminal_window = 1; #endif + Rect r; + + r.top = r.left = r.bottom = r.right = 0; mwp = fp->output_data.mac; if (making_terminal_window) { ! status = CreateNewWindow(kDocumentWindowClass, 0, &r, &mwp->mWP); ! if (status != noErr) abort (); making_terminal_window = 0; } else ! { ! status = CreateNewWindow(kDocumentWindowClass, 0, &r, &mwp->mWP); ! if (status != noErr) ! abort (); ! } SetWRefCon (mwp->mWP, (long) mwp); /* so that update events can find this mac_output struct */ Index: src/macmenu.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/macmenu.c,v retrieving revision 1.12 diff -c -r1.12 macmenu.c *** src/macmenu.c 1 Sep 2003 15:45:56 -0000 1.12 --- src/macmenu.c 3 Nov 2003 00:22:56 -0000 *************** *** 1943,1948 **** --- 1943,1950 ---- SInt16 part_code; int control_part_code; Point mouse; + OSStatus status; + Rect r; dialog_name = wv->name; nb_buttons = dialog_name[1] - '0'; *************** *** 1966,1972 **** wv = wv->next; } ! window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowPtr) -1); #if TARGET_API_MAC_CARBON SetPort (GetWindowPort (window_ptr)); --- 1968,1978 ---- wv = wv->next; } ! r.top = r.bottom = r.left = r.right = 0; ! ! status = CreateNewWindow(kWindowModalDialogProc, 0, &rect, &window_ptr); ! if (status != noErr) ! window_ptr = 0; #if TARGET_API_MAC_CARBON SetPort (GetWindowPort (window_ptr)); --Apple-Mail-1--681885490 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel --Apple-Mail-1--681885490--