Commit caf49fb0 authored by Dan Nicolaescu's avatar Dan Nicolaescu
Browse files

* loadup.el: Load mac-win on a Mac. Avoid loading both x-win and

mac-win.
* term/mac-win.el:
(mac-initialize-window-system): New function. Move global setup
here.

* s/darwin.h (SYSTEM_PURESIZE_EXTRA): Define here.
(SYSTEM_PURESIZE_EXTRA): Only define on Carbon.

* emacsclient.c (decode_options): Don't use a tty on mac carbon.
parent 80ca7302
2007-05-19 Dan Nicolaescu <dann@ics.uci.edu>
* emacsclient.c (decode_options): Don't use a tty on mac carbon.
2007-05-17 Dan Nicolaescu <dann@ics.uci.edu>
* emacsclient.c (handle_sigtstp): Use the new name for the
......
......@@ -458,7 +458,7 @@ decode_options (argc, argv)
if (!tty && display)
window_system = 1;
#ifndef WINDOWSNT
#if !defined (WINDOWSNT) && !defined (HAVE_CARBON)
else
tty = 1;
#endif
......
......@@ -6,8 +6,11 @@
here.
(handle-args-function-alist, frame-creation-function-alist):
(window-system-initialization-alist): Add mac entries.
(x-setup-function-keys): New function containing all the
top level function key definitions.
* loadup.el: Load mac-win on a Mac.
* loadup.el: Load mac-win on a Mac. Avoid loading both x-win and
mac-win.
2007-05-17 Jason Rumney <jasonr@gnu.org>
......
......@@ -212,7 +212,7 @@
(if (eq system-type 'macos)
(progn
(load "ls-lisp")))
(if (eq system-type 'darwin)
(if (and (eq system-type 'darwin) (not (featurep 'x)))
(progn
(load "term/mac-win")))
(if (fboundp 'atan) ; preload some constants and
......
......@@ -1062,6 +1062,8 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
global-map)
(defun x-setup-function-keys (frame)
"Setup Function Keys for mac."
;; Map certain keypad keys into ASCII characters
;; that people usually expect.
(define-key local-function-key-map [backspace] [?\d])
......@@ -1078,6 +1080,7 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
(define-key local-function-key-map [M-clear] [?\M-\C-l])
(define-key local-function-key-map [M-return] [?\M-\C-m])
(define-key local-function-key-map [M-escape] [?\M-\e])
)
;; These tell read-char how to convert
;; these special chars to ASCII.
......@@ -2281,34 +2284,6 @@ See also `mac-dnd-known-types'."
(mac-dnd-drop-data event (selected-frame) window
(cdr item) (car item) action)))))
;;; Do the actual Windows setup here; the above code just defines
;;; functions and variables that we use now.
(setq command-line-args (x-handle-args command-line-args))
;;; Make sure we have a valid resource name.
(or (stringp x-resource-name)
(let (i)
(setq x-resource-name (invocation-name))
;; Change any . or * characters in x-resource-name to hyphens,
;; so as not to choke when we use it in X resource queries.
(while (setq i (string-match "[.*]" x-resource-name))
(aset x-resource-name i ?-))))
(if (x-display-list)
;; On Mac OS 8/9, Most coding systems used in code conversion for
;; font names are not ready at the time when the terminal frame is
;; created. So we reconstruct font name table for the initial
;; frame.
(mac-clear-font-name-table)
(x-open-connection "Mac"
x-command-line-resources
;; Exit Emacs with fatal error if this fails.
t))
(setq frame-creation-function 'x-create-frame-with-faces)
(defvar mac-font-encoder-list
'(("mac-roman" mac-roman-encoder
ccl-encode-mac-roman-font "%s")
......@@ -2486,6 +2461,88 @@ It returns a name of the created fontset."
(fontset-add-mac-fonts fontset t)
fontset))
(defun x-win-suspend-error ()
(error "Suspending an Emacs running under Mac makes no sense"))
(defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value)
(defvar mac-initialized nil
"Non-nil if the w32 window system has been initialized.")
(defun mac-initialize-window-system ()
"Initialize Emacs for Mac GUI frames."
;;; Do the actual Windows setup here; the above code just defines
;;; functions and variables that we use now.
(setq command-line-args (x-handle-args command-line-args))
;;; Make sure we have a valid resource name.
(or (stringp x-resource-name)
(let (i)
(setq x-resource-name (invocation-name))
;; Change any . or * characters in x-resource-name to hyphens,
;; so as not to choke when we use it in X resource queries.
(while (setq i (string-match "[.*]" x-resource-name))
(aset x-resource-name i ?-))))
(if (x-display-list)
;; On Mac OS 8/9, Most coding systems used in code conversion for
;; font names are not ready at the time when the terminal frame is
;; created. So we reconstruct font name table for the initial
;; frame.
(mac-clear-font-name-table)
(x-open-connection "Mac"
x-command-line-resources
;; Exit Emacs with fatal error if this fails.
t))
(add-hook 'suspend-hook 'x-win-suspend-error)
;;; Arrange for the kill and yank functions to set and check the clipboard.
(setq interprogram-cut-function 'x-select-text)
(setq interprogram-paste-function 'x-get-selection-value)
;;; Turn off window-splitting optimization; Mac is usually fast enough
;;; that this is only annoying.
(setq split-window-keep-point t)
;; Don't show the frame name; that's redundant.
(setq-default mode-line-frame-identification " ")
;; Turn on support for mouse wheels.
(mouse-wheel-mode 1)
;; Enable CLIPBOARD copy/paste through menu bar commands.
(menu-bar-enable-clipboard)
;; Initiate drag and drop
(define-key special-event-map [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event)
;;;; Non-toolkit Scroll bars
(unless x-toolkit-scroll-bars
;; for debugging
;; (defun mac-handle-scroll-bar-event (event) (interactive "e") (princ event))
;;(global-set-key [vertical-scroll-bar mouse-1] 'mac-handle-scroll-bar-event)
(global-set-key
[vertical-scroll-bar down-mouse-1]
'mac-handle-scroll-bar-event)
(global-unset-key [vertical-scroll-bar drag-mouse-1])
(global-unset-key [vertical-scroll-bar mouse-1])
;; Adjust Courier font specifications in x-fixed-font-alist.
(let ((courier-fonts (assoc "Courier" x-fixed-font-alist)))
(if courier-fonts
......@@ -2592,62 +2649,6 @@ ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman")
(setq default-frame-alist
(cons '(reverse . t) default-frame-alist)))))
(defun x-win-suspend-error ()
(error "Suspending an Emacs running under Mac makes no sense"))
(defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value)
(defvar mac-initialized nil
"Non-nil if the w32 window system has been initialized.")
(defun mac-initialize-window-system ()
"Initialize Emacs for Mac GUI frames."
(add-hook 'suspend-hook 'x-win-suspend-error)
;;; Arrange for the kill and yank functions to set and check the clipboard.
(setq interprogram-cut-function 'x-select-text)
(setq interprogram-paste-function 'x-get-selection-value)
;;; Turn off window-splitting optimization; Mac is usually fast enough
;;; that this is only annoying.
(setq split-window-keep-point t)
;; Don't show the frame name; that's redundant.
(setq-default mode-line-frame-identification " ")
;; Turn on support for mouse wheels.
(mouse-wheel-mode 1)
;; Enable CLIPBOARD copy/paste through menu bar commands.
(menu-bar-enable-clipboard)
;; Initiate drag and drop
(define-key special-event-map [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event)
;;;; Non-toolkit Scroll bars
(unless x-toolkit-scroll-bars
;; for debugging
;; (defun mac-handle-scroll-bar-event (event) (interactive "e") (princ event))
;;(global-set-key [vertical-scroll-bar mouse-1] 'mac-handle-scroll-bar-event)
(global-set-key
[vertical-scroll-bar down-mouse-1]
'mac-handle-scroll-bar-event)
(global-unset-key [vertical-scroll-bar drag-mouse-1])
(global-unset-key [vertical-scroll-bar mouse-1])
(setq mac-initialized t)))
(defun mac-handle-scroll-bar-event (event)
......
2007-05-19 Dan Nicolaescu <dann@ics.uci.edu>
* frame.c (Fmake_terminal_frame): Disable output method test.
* s/darwin.h (SYSTEM_PURESIZE_EXTRA): Define here.
(SYSTEM_PURESIZE_EXTRA): Only define on Carbon.
* termhooks.h (union display_info): Add mac_display_info.
......@@ -32,6 +35,7 @@
(Fx_open_connection): Remove window-system check.
(start_hourglass): Likewise.
(x_create_tip_frame): Get the keyboard from the terminal.
(Fx_create_frame): Don't use FRAME_MAC_DISPLAY_INFO.
* w32fns.c (Fx_create_frame): Use kboard from the terminal.
......
......@@ -702,7 +702,9 @@ affects all frames on the same terminal device. */)
abort ();
#else /* not MSDOS */
#ifdef MAC_OS
#if 0 /* #ifdef MAC_OS */
/* This can happen for multi-tty when using both terminal frames and
Carbon frames. */
if (sf->output_method != output_mac)
error ("Not running on a Macintosh screen; cannot make a new Macintosh frame");
#else
......
......@@ -2590,7 +2590,7 @@ This function is an internal primitive--use `make-frame' instead. */)
f->icon_name = Qnil;
/* XXX Is this needed? */
FRAME_MAC_DISPLAY_INFO (f) = dpyinfo;
/*FRAME_MAC_DISPLAY_INFO (f) = dpyinfo;*/
/* With FRAME_MAC_DISPLAY_INFO set up, this unwind-protect is safe. */
#if GLYPH_DEBUG
......
......@@ -50,12 +50,10 @@ Boston, MA 02110-1301, USA. */
#ifdef MAC_OSX
#ifdef HAVE_CARBON
#define MAC_OS
#endif
#endif
/* We need a little extra space, see ../../lisp/loadup.el. */
#define SYSTEM_PURESIZE_EXTRA 30000
#endif
#endif
/* SYSTEM_TYPE should indicate the kind of system you are using.
It sets the Lisp variable system-type. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment