all messages for Emacs-related lists mirrored at yhetil.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

* Re: Patch to get Emacs to work on MacOS 10.3 (Panther)
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Nozomu Ando @ 2003-11-03  8:28 UTC (permalink / raw)
  Cc: emacs-devel


On Nov 3, 2003, at 9:33 AM, Ted Lemon wrote:

> 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.

Perhaps you have clobbered Emacs.rsrc.
Didn't you see any error message when compiling?

Try cvs update and to build from scratch, please.

Nozomu Ando

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

* Re: Patch to get Emacs to work on MacOS 10.3 (Panther)
  2003-11-03  8:28 ` Nozomu Ando
@ 2003-11-03  9:22   ` Ted Lemon
  2003-11-03 10:08     ` Nozomu Ando
  0 siblings, 1 reply; 5+ messages in thread
From: Ted Lemon @ 2003-11-03  9:22 UTC (permalink / raw)


On Nov 3, 2003, at 2:28 AM, Nozomu Ando wrote:
> Perhaps you have clobbered Emacs.rsrc.
> Didn't you see any error message when compiling?

I did try that, several different ways, but it didn't work.   There is 
actually a problem building the resource file on 10.3 - Rez doesn't 
like the balloon help resource.   But if I #if out that resource and 
build a new resource file, Emacs still won't get to displaying a 
window.   With the diffs I provided, it works every time.

Is it your experience that Emacs works correctly on Panther without the 
patch I've provided?

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

* Re: Patch to get Emacs to work on MacOS 10.3 (Panther)
  2003-11-03  9:22   ` Ted Lemon
@ 2003-11-03 10:08     ` Nozomu Ando
  2003-11-04  3:48       ` Ted Lemon
  0 siblings, 1 reply; 5+ messages in thread
From: Nozomu Ando @ 2003-11-03 10:08 UTC (permalink / raw)
  Cc: emacs-devel

From: Ted Lemon <mellon@fugue.com>
Subject: Re: Patch to get Emacs to work on MacOS 10.3 (Panther)
Date: Mon, 03 Nov 2003 03:22:11 -0600

> On Nov 3, 2003, at 2:28 AM, Nozomu Ando wrote:
> I did try that, several different ways, but it didn't work.   There is 
> actually a problem building the resource file on 10.3 - Rez doesn't 
> like the balloon help resource.

This problem is fixed on revision 1.5 of Emacs.r.

> Is it your experience that Emacs works correctly on Panther without the 
> patch I've provided?

Yes, always (after 1.5 of Emacs.r).

Regards,
Nozomu Ando

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

* Re: Patch to get Emacs to work on MacOS 10.3 (Panther)
  2003-11-03 10:08     ` Nozomu Ando
@ 2003-11-04  3:48       ` Ted Lemon
  0 siblings, 0 replies; 5+ messages in thread
From: Ted Lemon @ 2003-11-04  3:48 UTC (permalink / raw)
  Cc: emacs-devel

On Nov 3, 2003, at 4:08 AM, Nozomu Ando wrote:
> Yes, always (after 1.5 of Emacs.r).

You're right - with version 1.5 of Emacs.r, Emacs does load and run 
successfully on Panther.   Apparently not only the balloon help 
resource, but the other two resources preceding it, were causing a 
problem.

I am still curious, though, why we need the resource at all, given that 
there are functions for creating windows in Carbon that don't require 
resources, and that work correctly.   It seems like it would be easier 
to maintain the code if these functions were used instead of 
GetNewCWindow, which is deprecated in the Carbon API (at least 
according to the Panther docs).

^ 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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.