unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ted Lemon <mellon@fugue.com>
Subject: Patch to get Emacs to work on MacOS 10.3 (Panther)
Date: Sun, 2 Nov 2003 18:33:47 -0600	[thread overview]
Message-ID: <636D6972-0D95-11D8-A8A6-000A95D9C74C@fugue.com> (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

             reply	other threads:[~2003-11-03  0:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-03  0:33 Ted Lemon [this message]
2003-11-03  8:28 ` Patch to get Emacs to work on MacOS 10.3 (Panther) Nozomu Ando
2003-11-03  9:22   ` Ted Lemon
2003-11-03 10:08     ` Nozomu Ando
2003-11-04  3:48       ` Ted Lemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=636D6972-0D95-11D8-A8A6-000A95D9C74C@fugue.com \
    --to=mellon@fugue.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).