aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu <[email protected]>2007-05-19 23:12:46 +0000
committerDan Nicolaescu <[email protected]>2007-05-19 23:12:46 +0000
commitcaf49fb0438e9493456b59cf9eab845e0e568e2a (patch)
treec9979007c35f2c096b6e96632d8f79d4c2e0c2e2
parent80ca7302d820bd3460a06db39165bbc35144c684 (diff)
* 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.
-rw-r--r--lib-src/ChangeLog.multi-tty4
-rw-r--r--lib-src/emacsclient.c2
-rw-r--r--lisp/ChangeLog.multi-tty5
-rw-r--r--lisp/loadup.el2
-rw-r--r--lisp/term/mac-win.el169
-rw-r--r--src/ChangeLog.multi-tty4
-rw-r--r--src/frame.c4
-rw-r--r--src/macfns.c2
-rw-r--r--src/s/darwin.h6
9 files changed, 105 insertions, 93 deletions
diff --git a/lib-src/ChangeLog.multi-tty b/lib-src/ChangeLog.multi-tty
index f118b0b2d7..f8eedb5d75 100644
--- a/lib-src/ChangeLog.multi-tty
+++ b/lib-src/ChangeLog.multi-tty
@@ -1,3 +1,7 @@
+2007-05-19 Dan Nicolaescu <[email protected]>
+
+ * emacsclient.c (decode_options): Don't use a tty on mac carbon.
+
2007-05-17 Dan Nicolaescu <[email protected]>
* emacsclient.c (handle_sigtstp): Use the new name for the
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index c7c2f00c32..8e8cb9b379 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -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
diff --git a/lisp/ChangeLog.multi-tty b/lisp/ChangeLog.multi-tty
index e1189407bb..bdcd367a19 100644
--- a/lisp/ChangeLog.multi-tty
+++ b/lisp/ChangeLog.multi-tty
@@ -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 <[email protected]>
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 8c03610043..d936215838 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -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
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 281aaf2e83..9c8827b0ae 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -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)
diff --git a/src/ChangeLog.multi-tty b/src/ChangeLog.multi-tty
index 4f173a3962..8a1a1dbd1d 100644
--- a/src/ChangeLog.multi-tty
+++ b/src/ChangeLog.multi-tty
@@ -1,6 +1,9 @@
2007-05-19 Dan Nicolaescu <[email protected]>
+ * 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.
diff --git a/src/frame.c b/src/frame.c
index 859802995a..5b8f9acaf0 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -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
diff --git a/src/macfns.c b/src/macfns.c
index 382259e2fc..4c454399af 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -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
diff --git a/src/s/darwin.h b/src/s/darwin.h
index 72ed8964a7..2cc6ef1cdf 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -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. */