unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Patch to get Emacs to work on MacOS 10.3 (Panther)
@ 2003-11-03  0:33 Ted Lemon
  2003-11-03  8:28 ` Nozomu Ando
  0 siblings, 1 reply; 5+ messages in thread
From: Ted Lemon @ 2003-11-03  0:33 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1018 bytes --]

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.


[-- Attachment #2: foo --]
[-- Type: application/octet-stream, Size: 2753 bytes --]

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));

[-- Attachment #3: Type: text/plain, Size: 141 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-11-04  3:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-03  0:33 Patch to get Emacs to work on MacOS 10.3 (Panther) Ted Lemon
2003-11-03  8:28 ` Nozomu Ando
2003-11-03  9:22   ` Ted Lemon
2003-11-03 10:08     ` Nozomu Ando
2003-11-04  3:48       ` Ted Lemon

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).