Commit 1a578e9b authored by Andrew Choi's avatar Andrew Choi
Browse files

Initial check-in: changes for building Emacs under Mac OS.

2000-10-23  Andrew Choi  <>

	* dispextern.h [macintosh]: Include macgui.h instead of macterm.h.

	* dispnew.c [macintosh]: Include macterm.h.
	(init_display) [macintosh]: initialization for window system.

	* emacs.c (main) [macintosh]: Call syms_of_textprop,
	syms_of_macfns, syms_of_ccl, syms_of_fontset, syms_of_xterm,
	syms_of_search, x_term_init, and init_keyboard before calling
	init_window_once.  Also, call syms_of_xmenu.

	* fontset.c (syms_of_fontset) [macintosh]: Set ASCII font of
	default fontset to Monaco.

	* frame.c [macintosh]: Include macterm.h.  Remove declarations of
	NewMacWindow and DisposeMacWindow.
	(make_terminal_frame) [macintosh]: Call make_mac_terminal_frame
	instead of calling NewMacWindow and setting fields of
	f->output_data.mac directly.  Call init_frame_faces.
	(Fdelete_frame) [macintosh]: Remove unused code.
	(Fmodify_frame_parameters) [macintosh]: Call
	x_set_frame_parameters instead of mac_set_frame_parameters.

	* frame.h [macintosh]: Define menu_bar_lines field in struct
	frame.  Define FRAME_EXTERNAL_MENU_BAR macro.

	* keyboard.c [macintosh]: Include macterm.h.
	(kbd_buffer_get_event) [macintosh]: Generate delete_window_event
	and menu_bar_activate_event type events as for X and NT.
	(make_lispy_event) [macintosh]: Construct lisp events of type
	MENU_BAR_EVENT as for X and NT.

	* sysdep.c [macintosh]: Remove declaration for sys_signal.
	Include stdlib.h.  Remove definition of Vx_bitmap_file_path.
	(sys_subshell) [macintosh]: Remove definition entirely.
	(init_sys_modes) [macintosh]: Do not initialize Vwindow_system and
	Vwindow_system_version here.  Remove initialization of
	(read_input_waiting): Correct the number of parameters passed to
	Move all Macintosh functions to mac/mac.c.

	* term.c [macintosh]: Include macterm.h.

	* window.c [macintosh]: Include macterm.h.

	* xdisp.c [macintosh]: Include macterm.h.  Declare
	set_frame_menubar and pending_menu_activation.
	(echo_area_display) [macintosh]: Do not return if terminal frame
	is the selected frame.
	(update_menu_bar) [macintosh]: Check FRAME_EXTERNAL_MENU_BAR (f).
	Allow only the selected frame to set menu bar.
	(redisplay_window) [macintosh]: Obtain menu bar to redisplay by
	(display_menu_bar) [macintosh]: Check FRAME_MAC_P (f).

	* xfaces.c [macintosh]: Include macterm.h.  Define x_display_info
	and check_x.  Declare XCreateGC.  Define x_create_gc and
	x_free_gc.  Initialize font_sort_order.
	(x_face_list_fonts) [macintosh]: Use the same code as WINDOWSNT,
	but call x_list_fonts instead of w32_list_fonts.
	(Finternal_face_x_get_resource) [macintosh]: Do not call
	(prepare_face_for_display) [macintosh]: Set xgcv.font.
	(realize_x_face) [macintosh]: Load the font if it is specified in
	(syms_of_xfaces) [macintosh]: Initialize Vscalable_fonts_allowed
	to Qt.

	* cus-edit.el (custom-button-face): Use 3D look for mac.
	(custom-button-pressed-face): Likewise.

	* faces.el (set-face-attributes-from-resources): Handle mac frames
	in the same way as x and w32 frames.
	(face-valid-attribute-values): Likewise.
	(read-face-attribute): Likewise.
	(defined-colors): Likewise.
	(color-defined-p): Likewise.
	(color-values): Likewise.
	(display-grayscale-p): Likewise.
	(face-set-after-frame-default): Likewise.
	(mode-line): Same default face as for x and w32.
	(tool-bar): Likewise.

	* frame.el: Remove call to frame-notice-user-settings at end of
	the file.

	* info.el (Info-fontify-node): make underlines invisible for mac
	as for x, pc, and w32 frame types.

	* term/mac-win.el: New file.
parent d371949a
2000-10-23 Andrew Choi <>
* cus-edit.el (custom-button-face): Use 3D look for mac.
(custom-button-pressed-face): Likewise.
* faces.el (set-face-attributes-from-resources): Handle mac frames
in the same way as x and w32 frames.
(face-valid-attribute-values): Likewise.
(read-face-attribute): Likewise.
(defined-colors): Likewise.
(color-defined-p): Likewise.
(color-values): Likewise.
(display-grayscale-p): Likewise.
(face-set-after-frame-default): Likewise.
(mode-line): Same default face as for x and w32.
(tool-bar): Likewise.
* frame.el: Remove call to frame-notice-user-settings at end of
the file.
* info.el (Info-fontify-node): make underlines invisible for mac
as for x, pc, and w32 frame types.
* term/mac-win.el: New file.
2000-10-22 Dave Love <>
* textmodes/refill.el: New file.
......@@ -1711,6 +1711,9 @@ and `face'."
(((type w32) (class color)) ; Like default modeline
(:box (:line-width 2 :style released-button)
:background "lightgrey" :foreground "black"))
(((type mac) (class color)) ; Like default modeline
(:box (:line-width 2 :style released-button)
:background "lightgrey" :foreground "black"))
"Face used for buttons in customization buffers."
......@@ -1724,6 +1727,9 @@ and `face'."
(((type w32) (class color))
(:box (:line-width 2 :style pressed-button)
:background "lightgrey" :foreground "black"))
(((type mac) (class color))
(:box (:line-width 2 :style pressed-button)
:background "lightgrey" :foreground "black"))
(:inverse-video t)))
"Face used for buttons in customization buffers."
......@@ -300,7 +300,7 @@ specifies an invalid attribute."
(defun set-face-attributes-from-resources (face frame)
"Set attributes of FACE from X resources for FRAME."
(when (memq (framep frame) '(x w32))
(when (memq (framep frame) '(x w32 mac))
(dolist (definition face-x-resources)
(let ((attribute (car definition)))
(dolist (entry (cdr definition))
......@@ -777,7 +777,7 @@ an integer value."
(and (memq window-system '(x w32))
(and (memq window-system '(x w32 mac))
(mapcar #'list
(apply #'nconc
(mapcar (lambda (dir)
......@@ -1231,7 +1231,7 @@ is used. If nil or omitted, use the selected frame."
The argument FRAME specifies which frame to try.
The value may be different for frames on different display types.
If FRAME doesn't support colors, the value is nil."
(if (memq (framep (or frame (selected-frame))) '(x w32))
(if (memq (framep (or frame (selected-frame))) '(x w32 mac))
(xw-defined-colors frame)
(mapcar 'car (tty-color-alist frame))))
(defalias 'x-defined-colors 'defined-colors)
......@@ -1243,7 +1243,7 @@ If COLOR is the symbol `unspecified' or one of the strings
\"unspecified-fg\" or \"unspecified-bg\", the value is nil."
(if (member color '(unspecified "unspecified-bg" "unspecified-fg"))
(if (member (framep (or frame (selected-frame))) '(x w32))
(if (member (framep (or frame (selected-frame))) '(x w32 mac))
(xw-color-defined-p color frame)
(numberp (tty-color-translate color frame)))))
(defalias 'x-color-defined-p 'color-defined-p)
......@@ -1258,7 +1258,7 @@ If COLOR is the symbol `unspecified' or one of the strings
\"unspecified-fg\" or \"unspecified-bg\", the value is nil."
(if (member color '(unspecified "unspecified-fg" "unspecified-bg"))
(if (memq (framep (or frame (selected-frame))) '(x w32))
(if (memq (framep (or frame (selected-frame))) '(x w32 mac))
(xw-color-values color frame)
(tty-color-values color frame))))
(defalias 'x-color-values 'color-values)
......@@ -1268,7 +1268,7 @@ If COLOR is the symbol `unspecified' or one of the strings
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display."
(if (memq (framep-on-display display) '(x w32))
(if (memq (framep-on-display display) '(x w32 mac))
(xw-display-color-p display)
(tty-display-color-p display)))
(defalias 'x-display-color-p 'display-color-p)
......@@ -1445,7 +1445,7 @@ Initialize colors of certain faces from frame parameters."
(when spec
(face-spec-set face spec frame))
(internal-merge-in-global-face face frame)
(when (memq window-system '(x w32))
(when (memq window-system '(x w32 mac))
(make-face-x-resource-internal face frame))))
;; Initialize attributes from frame parameters.
......@@ -1527,7 +1527,7 @@ created."
(defface mode-line
'((((type x w32) (class color))
'((((type x w32 mac) (class color))
(:box (:line-width 2 :style released-button)
:background "grey75" :foreground "black"))
......@@ -1572,7 +1572,7 @@ created."
(defface tool-bar
'((((type x w32) (class color))
'((((type x w32 mac) (class color))
(:box (:line-width 1 :style released-button)
:background "grey75" :foreground "black"))
(((type x) (class mono))
......@@ -1164,4 +1164,3 @@ If nil, don't show a cursor except in the selected window."
(provide 'frame)
;;; frame.el ends here
......@@ -2427,7 +2427,7 @@ the variable `Info-file-list-for-emacs'."
;; This is a serious problem for trying to handle multiple
;; frame types at once. We want this text to be invisible
;; on frames that can display the font above.
(if (memq (framep (selected-frame)) '(x pc w32))
(if (memq (framep (selected-frame)) '(x pc w32 mac))
(add-text-properties (match-end 1) (match-end 2)
'(invisible t intangible t))))
(goto-char (point-min))
This diff is collapsed.
; MPW does not allow saving a file with name beginning with a period.
; Use Emacs or SimpleText to edit and save this file instead.
(cond ((fboundp 'global-font-lock-mode)
;; Turn on font-lock in all modes that support it
(global-font-lock-mode t)
;; Maximum colors
(setq font-lock-maximum-decoration t)))
(setq default-frame-alist '((font . "fontset-mac")))
2000-10-20 Andrew Choi <>
* INSTALL: New file.
* README: New file.
* TODO: New file.
* emacs-cw5.mcp.xml: New file.
* emacs-cw6.mcp.xml: New file.
* makefile.MPW: New file.
* inc/alloca.h: New file.
* inc/cmdline-defs-cw5.h: New file.
* inc/cmdline-defs-cw6.h: New file.
* inc/config.h: New file.
* inc/dirent.h: New file.
* inc/epaths.h: New file.
* inc/m-mac.h: New file.
* inc/macgui.h: New file.
* inc/macterm.h: New file.
* inc/pwd.h: New file.
* inc/s-mac.h: New file.
* inc/termio.h: New file.
* inc/utime.h: New file.
* inc/utsname.h: New file.
* inc/sys/file.h: New file.
* inc/sys/ioctl.h: New file.
* inc/sys/param.h: New file.
* inc/sys/stat.h: New file.
* inc/sys/time.h: New file.
* inc/sys/types.h: New file.
* src/Emacs.r: New file.
* src/EmacsMPW.r: New file.
* src/chdir.c: New file.
* src/mac.c: New file.
* src/macfns.c: New file.
* src/macmenu.c: New file.
* src/macterm.c: New file.
* BUILDING EMACS ON THE MAC OS -*- outline -*-
You can use either Metrowerks CodeWarrior Pro 5 or 6 or MPW-GM
(Aug. 2000) to build Emacs. MPW-GM can be downloaded free of charge
from Apple at
You will need MPW-GM to build the make-docfile utility and to generate
the doc string file DOC.
To decompress files, you can use MacGzip from
and to untar them, you can use tar 4.0 from
(Optional) If you wish to fetch files from the Emacs CVS repository
directly to your Mac, you can use the CVS client MacCVS, which can be
downloaded from
(Optional) A subset of the fonts from the GNU intlfonts-1.2
distribution converted to NFNT format can be obtained from
To build Emacs in the MPW Shell, simply set the directory to
...:emacs:mac: and build the target Emacs of the make file
makefile.mpw. I.e., execute the commands
make Emacs -f makefile.MPW > Emacs.MakeScript
To build Emacs using CodeWarrior, start up the CodeWarrior IDE, choose
File->Import Project... and select the file emacs-cw5.mcp.xml or
emacs-cw6.mcp.xml, depending on which verison of CodeWarrior used.
When prompted to save the project, navigate to same directory as the
file emacs-cw[56].mcp.xml, name it emacs-cw5.mcp or emacs-cw6.mcp, and
save it there. Then choose Project->Make. Note that this does not
build the DOC file. To do so, use MPW and build the target "Doc" in
Once built, the Emacs application (Emacs CW or Emacs MPW) can be
launched where it is created.
To build an optimized version of Emacs in CodeWarrior, change the
value in the Emacs Settings->Code Generation->Global Optimization
dialog. To build a version for profiling, check the Profiler
Information box in the Emacs Settings->Code Generation->PPC Processor
dialog and include the Profiler PPC.Lib library.
To build optimized or debugging version of Emacs in MPW, follow the
comment in makefile.MPW to enable the -opt speed or -sym on option
(see note below).
The Mac version requires compiled Lisp files to be present in the lisp
directory to run properly. It is cumbersome to bootstrap from only
the Lisp source files. One way of getting the compiled Lisp files is
to build Emacs once on, say, a Unix system and transfer that directory
to the Mac. Note that linefeed conversion must be disabled when
transferring compiled Lisp files.
An alternative is to unzip and untar the archive lisp-elc.tgz. An
older version of frame.elc in the archive may cause a problem when the
Mac version starts up. If this is the case, simply remove or rename
that file. Then once Emacs runs, you can invoke
byte-recompile-directory on the lisp directory to byte-compile all
out-of-date Lisp files.
You may also need to run update-autoloads-from-directories on the lisp
directory to bring loaddefs.el up-to-date.
Emacs should build and run on a PowerMac running Mac OS 8.1 - 9.0.
You will need around 100 MB of disk space for the source files and
intermediate files.
It will not run on machines with more than 256 MB of physical or
virtual memory.
Currently there is no support for building the LEIM directory on the
Mac. However, it can be built on another platform and transferred to
the Mac.
When Emacs is built with "-opt speed" enabled in makefile.MPW,
optimization causes the functions reset_buffer_local_variables in
buffer.c and syms_of_lread in lread.c to crash. Avoid this by
enclosing them in the following pragmas.
#pragma options opt off
<function definition...>
#pragma options opt reset
To use the same icon as when Emacs is built on Windows NT, define
GNU_ICON in mac/src/Emacs.r.
GNU Emacs for Mac OS
This directory contains the files needed to build GNU Emacs on the Mac
OS (8.1-9.0). Many of the major features of the Unix version are
supported: multiple frames, colors, scroll bars, menu bars, use of the
mouse, fontsets, international characters, input methods, and coding
Mac OS specific support includes document drag-and-drop in the Finder,
transfer of text to and from other applications via the clipboard, and
sending AppleScript commands to other applications from Emacs.
The following are not yet supported: unexec (dump-emacs), asynchronous
subprocesses (start-process), and networking
There is basic support for synchronous subprocesses (call-process)
although Unix commands that are used will need to be ported to the
Metrowerks CodeWarrior Pro 5 or Pro 6 or MPW-GM (August 2000) can be
used to build Emacs on the Mac OS. See the INSTALL file in this
directory for instructions on building Emacs.
Binary distributions are available at
At this site you can also find an FAQ, mailing lists, and dicussion
forums for discussing issues related to running GNU Emacs on Mac OS.
This diff is collapsed.
This diff is collapsed.
#ifndef _ALLOCA_H_
#define _ALLOCA_H_
#if __MRC__
void *__alloca(size_t size);
\ No newline at end of file
#define emacs 1
\ No newline at end of file
#define emacs 1
/* Handcrafted Emacs site configuration file for Mac OS. -*- C -*- */
/* GNU Emacs site configuration template file. -*- C -*-
Copyright (C) 1988, 1993, 1994, 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs 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.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* No code in Emacs #includes config.h twice, but some of the code
intended to work with other packages as well (like gmalloc.c)
think they can include it as many times as they like. */
/* These are all defined in the top-level Makefile by configure.
They're here only for reference. */
/* Define GNU_MALLOC if you want to use the GNU memory allocator. */
/* #undef GNU_MALLOC */
/* Define if you are using the GNU C Library. */
/* #undef DOUG_LEA_MALLOC */
/* Define REL_ALLOC if you want to use the relocating allocator for
buffer space. */
/* #undef REL_ALLOC */
/* Define HAVE_X_WINDOWS if you want to use the X window system. */
/* #undef HAVE_X_WINDOWS */
/* Define HAVE_X11 if you want to use version 11 of X windows.
Otherwise, Emacs expects to use version 10. */
/* #undef HAVE_X11 */
/* Define if using an X toolkit. */
/* #undef USE_X_TOOLKIT */
/* Define this if you're using XFree386. */
/* #undef HAVE_XFREE386 */
/* Define this if you have Motif 2.1 or newer. */
/* #undef HAVE_MOTIF_2_1 */
/* Define HAVE_MENUS if you have mouse menus.
(This is automatic if you use X, but the option to specify it remains.)
It is also defined with other window systems that support xmenu.c. */
#define HAVE_MENUS 1
/* Define if we have the X11R6 or newer version of Xt. */
/* #undef HAVE_X11XTR6 */
/* Define if we have the X11R6 or newer version of Xlib. */
/* #undef HAVE_X11R6 */
/* Define if we have the X11R5 or newer version of Xlib. */
/* #undef HAVE_X11R5 */
/* Define if we have the XPM libary. */
/* #undef HAVE_XPM */
/* Define if we have the PNG library. */
/* #undef HAVE_PNG */
/* Define if we have the JPEG library. */
/* #undef HAVE_JPEG */
/* Define if we have the TIFF library. */
/* #undef HAVE_TIFF */
/* Define if we have the GIF library. */
/* #undef HAVE_GIF */
/* Define if libXaw3d is available. */
/* #undef HAVE_XAW3D */
/* Define if we should use toolkit scroll bars. */
/* Define if we should use XIM, if it is available. */
/* #undef USE_XIM */
/* Define if netdb.h declares h_errno. */
/* #undef HAVE_H_ERRNO */
/* If we're using any sort of window system, define some consequences. */
#define HAVE_MOUSE
/* Define for MacOS */
#define HAVE_MOUSE 1
/* Define USER_FULL_NAME to return a string
that is the user's full name.
It can assume that the variable `pw'
points to the password file entry for this user.
At some sites, the pw_gecos field contains
the user's full name. If neither this nor any other
field contains the right thing, use pw_name,
giving the user's login name, since that is better than nothing. */
#define USER_FULL_NAME pw->pw_name
/* Define AMPERSAND_FULL_NAME if you use the convention
that & in the full name stands for the login id. */
/* Turned on June 1996 supposing nobody will mind it. */
/* Things set by --with options in the configure script. */
/* Define to support POP mail retrieval. */
/* #undef MAIL_USE_POP 1 */
/* Define to support Kerberos-authenticated POP mail retrieval. */
/* #undef KERBEROS */
/* Define to use Kerberos 5 instead of Kerberos 4 */
/* #undef KERBEROS5 */
/* Define to support GSS-API in addition to (or instead of) Kerberos */
/* #undef GSSAPI */
/* Define to support using a Hesiod database to find the POP server. */
/* #undef HESIOD */
/* Header for Voxware or PCM sound card driver. */
/* #undef HAVE_SOUNDCARD_H */
/* Define HAVE_SOUND if we have sound support. We know it works
and compiles only on the specified platforms. For others,
it probably doesn't make sense to try. */
#if defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
#define HAVE_SOUND 1
#define HAVE_SOUND 1
#define HAVE_SOUND 1
#endif /* __FreeBSD__ || __NetBSD__ || __linux__ */
/* Some things figured out by the configure script, grouped as they are in */
#ifndef _ALL_SOURCE /* suppress warning if this is pre-defined */
/* #undef _ALL_SOURCE */
/* #undef HAVE_SYS_SELECT_H */
/* #undef HAVE_SYS_TIMEB_H */
#define HAVE_SYS_TIME_H 1
#ifdef __MRC__
#else /* CodeWarrior */
#define HAVE_UNISTD_H 1
#define HAVE_UTIME_H 1
/* #undef HAVE_TERMIOS_H */
#define HAVE_LIMITS_H 1
#define HAVE_STRING_H 1
/* #undef HAVE_STDLIB_H */
/* #undef HAVE_TERMCAP_H */
/* #undef HAVE_TERM_H */
/* #undef HAVE_STDIO_EXT_H */
/* #undef STDC_HEADERS */
/* #undef TIME_WITH_SYS_TIME */
/* #undef HAVE_VFORK_H */
#define HAVE_FCNTL_H 1
/* #undef HAVE_SETITIMER */
/* #undef HAVE_UALARM */
/* #undef HAVE_SYS_WAIT_H */
/* #undef HAVE_LIBDNET */
/* #undef HAVE_LIBRESOLV */
/* #undef HAVE_LIBXMU */
/* #undef HAVE_LIBNCURSES */
/* #undef HAVE_LIBINTL */
/* #undef HAVE_LIBXP */
/* movemail Kerberos support */
/* libraries */
/* #undef HAVE_LIBKRB */
/* #undef HAVE_LIBKRB4 */
/* #undef HAVE_LIBDES */
/* #undef HAVE_LIBDES425 */
/* #undef HAVE_LIBKRB5 */
/* #undef HAVE_LIBCRYPTO */
/* #undef HAVE_LIBCOM_ERR */
/* header files */
/* #undef HAVE_KRB5_H */
/* #undef HAVE_DES_H */
/* #undef HAVE_KRB_H */
/* #undef HAVE_KERBEROS_DES_H */
/* #undef HAVE_KERBEROS_KRB_H */
/* #undef HAVE_COM_ERR_H */
/* GSS-API libraries and headers */
/* #undef HAVE_LIBGSSAPI_KRB5 */
/* #undef HAVE_LIBGSSAPI */
/* #undef HAVE_GSSAPI_H */
/* Mail-file locking */
/* #undef HAVE_LIBMAIL */
/* #undef HAVE_MAILLOCK_H */
/* #undef HAVE_TOUCHLOCK */
/* #undef HAVE_ALLOCA_H */
/* #undef HAVE_DEV_PTMX */
/* If we don't have gettimeofday,
the test for GETTIMEOFDAY_ONE_ARGUMENT may succeed,
but we should ignore it. */
/* #undef HAVE_DUP2 */
#define HAVE_RENAME 1
/* #undef TM_IN_SYS_TIME */
/* #undef HAVE_TM_ZONE */
/* #undef HAVE_TZNAME */
/* #undef HAVE_TM_GMTOFF */
/* #undef const */