aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2007-05-19 23:12:46 +0000
committerDan Nicolaescu2007-05-19 23:12:46 +0000
commitcaf49fb0438e9493456b59cf9eab845e0e568e2a (patch)
treec9979007c35f2c096b6e96632d8f79d4c2e0c2e2
parent80ca7302d820bd3460a06db39165bbc35144c684 (diff)
downloademacs-caf49fb0438e9493456b59cf9eab845e0e568e2a.tar.gz
emacs-caf49fb0438e9493456b59cf9eab845e0e568e2a.zip
* 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 f118b0b2d7c..f8eedb5d756 100644
--- a/lib-src/ChangeLog.multi-tty
+++ b/lib-src/ChangeLog.multi-tty
@@ -1,3 +1,7 @@
12007-05-19 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * emacsclient.c (decode_options): Don't use a tty on mac carbon.
4
12007-05-17 Dan Nicolaescu <dann@ics.uci.edu> 52007-05-17 Dan Nicolaescu <dann@ics.uci.edu>
2 6
3 * emacsclient.c (handle_sigtstp): Use the new name for the 7 * emacsclient.c (handle_sigtstp): Use the new name for the
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index c7c2f00c326..8e8cb9b379a 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -458,7 +458,7 @@ decode_options (argc, argv)
458 458
459 if (!tty && display) 459 if (!tty && display)
460 window_system = 1; 460 window_system = 1;
461#ifndef WINDOWSNT 461#if !defined (WINDOWSNT) && !defined (HAVE_CARBON)
462 else 462 else
463 tty = 1; 463 tty = 1;
464#endif 464#endif
diff --git a/lisp/ChangeLog.multi-tty b/lisp/ChangeLog.multi-tty
index e1189407bb6..bdcd367a195 100644
--- a/lisp/ChangeLog.multi-tty
+++ b/lisp/ChangeLog.multi-tty
@@ -6,8 +6,11 @@
6 here. 6 here.
7 (handle-args-function-alist, frame-creation-function-alist): 7 (handle-args-function-alist, frame-creation-function-alist):
8 (window-system-initialization-alist): Add mac entries. 8 (window-system-initialization-alist): Add mac entries.
9 (x-setup-function-keys): New function containing all the
10 top level function key definitions.
9 11
10 * loadup.el: Load mac-win on a Mac. 12 * loadup.el: Load mac-win on a Mac. Avoid loading both x-win and
13 mac-win.
11 14
122007-05-17 Jason Rumney <jasonr@gnu.org> 152007-05-17 Jason Rumney <jasonr@gnu.org>
13 16
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 8c03610043d..d9362158380 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -212,7 +212,7 @@
212(if (eq system-type 'macos) 212(if (eq system-type 'macos)
213 (progn 213 (progn
214 (load "ls-lisp"))) 214 (load "ls-lisp")))
215(if (eq system-type 'darwin) 215(if (and (eq system-type 'darwin) (not (featurep 'x)))
216 (progn 216 (progn
217 (load "term/mac-win"))) 217 (load "term/mac-win")))
218(if (fboundp 'atan) ; preload some constants and 218(if (fboundp 'atan) ; preload some constants and
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 281aaf2e83b..9c8827b0ae5 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")
1062(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame 1062(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
1063 global-map) 1063 global-map)
1064 1064
1065(defun x-setup-function-keys (frame)
1066 "Setup Function Keys for mac."
1065;; Map certain keypad keys into ASCII characters 1067;; Map certain keypad keys into ASCII characters
1066;; that people usually expect. 1068;; that people usually expect.
1067(define-key local-function-key-map [backspace] [?\d]) 1069(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")
1078(define-key local-function-key-map [M-clear] [?\M-\C-l]) 1080(define-key local-function-key-map [M-clear] [?\M-\C-l])
1079(define-key local-function-key-map [M-return] [?\M-\C-m]) 1081(define-key local-function-key-map [M-return] [?\M-\C-m])
1080(define-key local-function-key-map [M-escape] [?\M-\e]) 1082(define-key local-function-key-map [M-escape] [?\M-\e])
1083)
1081 1084
1082;; These tell read-char how to convert 1085;; These tell read-char how to convert
1083;; these special chars to ASCII. 1086;; these special chars to ASCII.
@@ -2281,34 +2284,6 @@ See also `mac-dnd-known-types'."
2281 (mac-dnd-drop-data event (selected-frame) window 2284 (mac-dnd-drop-data event (selected-frame) window
2282 (cdr item) (car item) action))))) 2285 (cdr item) (car item) action)))))
2283 2286
2284;;; Do the actual Windows setup here; the above code just defines
2285;;; functions and variables that we use now.
2286
2287(setq command-line-args (x-handle-args command-line-args))
2288
2289;;; Make sure we have a valid resource name.
2290(or (stringp x-resource-name)
2291 (let (i)
2292 (setq x-resource-name (invocation-name))
2293
2294 ;; Change any . or * characters in x-resource-name to hyphens,
2295 ;; so as not to choke when we use it in X resource queries.
2296 (while (setq i (string-match "[.*]" x-resource-name))
2297 (aset x-resource-name i ?-))))
2298
2299(if (x-display-list)
2300 ;; On Mac OS 8/9, Most coding systems used in code conversion for
2301 ;; font names are not ready at the time when the terminal frame is
2302 ;; created. So we reconstruct font name table for the initial
2303 ;; frame.
2304 (mac-clear-font-name-table)
2305 (x-open-connection "Mac"
2306 x-command-line-resources
2307 ;; Exit Emacs with fatal error if this fails.
2308 t))
2309
2310(setq frame-creation-function 'x-create-frame-with-faces)
2311
2312(defvar mac-font-encoder-list 2287(defvar mac-font-encoder-list
2313 '(("mac-roman" mac-roman-encoder 2288 '(("mac-roman" mac-roman-encoder
2314 ccl-encode-mac-roman-font "%s") 2289 ccl-encode-mac-roman-font "%s")
@@ -2486,6 +2461,88 @@ It returns a name of the created fontset."
2486 (fontset-add-mac-fonts fontset t) 2461 (fontset-add-mac-fonts fontset t)
2487 fontset)) 2462 fontset))
2488 2463
2464(defun x-win-suspend-error ()
2465 (error "Suspending an Emacs running under Mac makes no sense"))
2466
2467(defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value)
2468
2469(defvar mac-initialized nil
2470 "Non-nil if the w32 window system has been initialized.")
2471
2472(defun mac-initialize-window-system ()
2473 "Initialize Emacs for Mac GUI frames."
2474
2475;;; Do the actual Windows setup here; the above code just defines
2476;;; functions and variables that we use now.
2477
2478(setq command-line-args (x-handle-args command-line-args))
2479
2480;;; Make sure we have a valid resource name.
2481(or (stringp x-resource-name)
2482 (let (i)
2483 (setq x-resource-name (invocation-name))
2484
2485 ;; Change any . or * characters in x-resource-name to hyphens,
2486 ;; so as not to choke when we use it in X resource queries.
2487 (while (setq i (string-match "[.*]" x-resource-name))
2488 (aset x-resource-name i ?-))))
2489
2490(if (x-display-list)
2491 ;; On Mac OS 8/9, Most coding systems used in code conversion for
2492 ;; font names are not ready at the time when the terminal frame is
2493 ;; created. So we reconstruct font name table for the initial
2494 ;; frame.
2495 (mac-clear-font-name-table)
2496 (x-open-connection "Mac"
2497 x-command-line-resources
2498 ;; Exit Emacs with fatal error if this fails.
2499 t))
2500
2501(add-hook 'suspend-hook 'x-win-suspend-error)
2502
2503;;; Arrange for the kill and yank functions to set and check the clipboard.
2504(setq interprogram-cut-function 'x-select-text)
2505(setq interprogram-paste-function 'x-get-selection-value)
2506
2507
2508
2509
2510;;; Turn off window-splitting optimization; Mac is usually fast enough
2511;;; that this is only annoying.
2512(setq split-window-keep-point t)
2513
2514;; Don't show the frame name; that's redundant.
2515(setq-default mode-line-frame-identification " ")
2516
2517;; Turn on support for mouse wheels.
2518(mouse-wheel-mode 1)
2519
2520
2521;; Enable CLIPBOARD copy/paste through menu bar commands.
2522(menu-bar-enable-clipboard)
2523
2524
2525;; Initiate drag and drop
2526
2527(define-key special-event-map [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event)
2528
2529
2530;;;; Non-toolkit Scroll bars
2531
2532(unless x-toolkit-scroll-bars
2533
2534;; for debugging
2535;; (defun mac-handle-scroll-bar-event (event) (interactive "e") (princ event))
2536
2537;;(global-set-key [vertical-scroll-bar mouse-1] 'mac-handle-scroll-bar-event)
2538
2539(global-set-key
2540 [vertical-scroll-bar down-mouse-1]
2541 'mac-handle-scroll-bar-event)
2542
2543(global-unset-key [vertical-scroll-bar drag-mouse-1])
2544(global-unset-key [vertical-scroll-bar mouse-1])
2545
2489;; Adjust Courier font specifications in x-fixed-font-alist. 2546;; Adjust Courier font specifications in x-fixed-font-alist.
2490(let ((courier-fonts (assoc "Courier" x-fixed-font-alist))) 2547(let ((courier-fonts (assoc "Courier" x-fixed-font-alist)))
2491 (if courier-fonts 2548 (if courier-fonts
@@ -2592,62 +2649,6 @@ ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman")
2592 (setq default-frame-alist 2649 (setq default-frame-alist
2593 (cons '(reverse . t) default-frame-alist))))) 2650 (cons '(reverse . t) default-frame-alist)))))
2594 2651
2595(defun x-win-suspend-error ()
2596 (error "Suspending an Emacs running under Mac makes no sense"))
2597
2598(defalias 'x-cut-buffer-or-selection-value 'x-get-selection-value)
2599
2600(defvar mac-initialized nil
2601 "Non-nil if the w32 window system has been initialized.")
2602
2603(defun mac-initialize-window-system ()
2604 "Initialize Emacs for Mac GUI frames."
2605
2606(add-hook 'suspend-hook 'x-win-suspend-error)
2607
2608;;; Arrange for the kill and yank functions to set and check the clipboard.
2609(setq interprogram-cut-function 'x-select-text)
2610(setq interprogram-paste-function 'x-get-selection-value)
2611
2612
2613
2614
2615;;; Turn off window-splitting optimization; Mac is usually fast enough
2616;;; that this is only annoying.
2617(setq split-window-keep-point t)
2618
2619;; Don't show the frame name; that's redundant.
2620(setq-default mode-line-frame-identification " ")
2621
2622;; Turn on support for mouse wheels.
2623(mouse-wheel-mode 1)
2624
2625
2626;; Enable CLIPBOARD copy/paste through menu bar commands.
2627(menu-bar-enable-clipboard)
2628
2629
2630;; Initiate drag and drop
2631
2632(define-key special-event-map [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event)
2633
2634
2635;;;; Non-toolkit Scroll bars
2636
2637(unless x-toolkit-scroll-bars
2638
2639;; for debugging
2640;; (defun mac-handle-scroll-bar-event (event) (interactive "e") (princ event))
2641
2642;;(global-set-key [vertical-scroll-bar mouse-1] 'mac-handle-scroll-bar-event)
2643
2644(global-set-key
2645 [vertical-scroll-bar down-mouse-1]
2646 'mac-handle-scroll-bar-event)
2647
2648(global-unset-key [vertical-scroll-bar drag-mouse-1])
2649(global-unset-key [vertical-scroll-bar mouse-1])
2650
2651(setq mac-initialized t))) 2652(setq mac-initialized t)))
2652 2653
2653(defun mac-handle-scroll-bar-event (event) 2654(defun mac-handle-scroll-bar-event (event)
diff --git a/src/ChangeLog.multi-tty b/src/ChangeLog.multi-tty
index 4f173a3962d..8a1a1dbd1db 100644
--- a/src/ChangeLog.multi-tty
+++ b/src/ChangeLog.multi-tty
@@ -1,6 +1,9 @@
12007-05-19 Dan Nicolaescu <dann@ics.uci.edu> 12007-05-19 Dan Nicolaescu <dann@ics.uci.edu>
2 2
3 * frame.c (Fmake_terminal_frame): Disable output method test.
4
3 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Define here. 5 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Define here.
6 (SYSTEM_PURESIZE_EXTRA): Only define on Carbon.
4 7
5 * termhooks.h (union display_info): Add mac_display_info. 8 * termhooks.h (union display_info): Add mac_display_info.
6 9
@@ -32,6 +35,7 @@
32 (Fx_open_connection): Remove window-system check. 35 (Fx_open_connection): Remove window-system check.
33 (start_hourglass): Likewise. 36 (start_hourglass): Likewise.
34 (x_create_tip_frame): Get the keyboard from the terminal. 37 (x_create_tip_frame): Get the keyboard from the terminal.
38 (Fx_create_frame): Don't use FRAME_MAC_DISPLAY_INFO.
35 39
36 * w32fns.c (Fx_create_frame): Use kboard from the terminal. 40 * w32fns.c (Fx_create_frame): Use kboard from the terminal.
37 41
diff --git a/src/frame.c b/src/frame.c
index 859802995af..5b8f9acaf0c 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -702,7 +702,9 @@ affects all frames on the same terminal device. */)
702 abort (); 702 abort ();
703#else /* not MSDOS */ 703#else /* not MSDOS */
704 704
705#ifdef MAC_OS 705#if 0 /* #ifdef MAC_OS */
706 /* This can happen for multi-tty when using both terminal frames and
707 Carbon frames. */
706 if (sf->output_method != output_mac) 708 if (sf->output_method != output_mac)
707 error ("Not running on a Macintosh screen; cannot make a new Macintosh frame"); 709 error ("Not running on a Macintosh screen; cannot make a new Macintosh frame");
708#else 710#else
diff --git a/src/macfns.c b/src/macfns.c
index 382259e2fce..4c454399afb 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2590,7 +2590,7 @@ This function is an internal primitive--use `make-frame' instead. */)
2590 f->icon_name = Qnil; 2590 f->icon_name = Qnil;
2591 2591
2592 /* XXX Is this needed? */ 2592 /* XXX Is this needed? */
2593 FRAME_MAC_DISPLAY_INFO (f) = dpyinfo; 2593 /*FRAME_MAC_DISPLAY_INFO (f) = dpyinfo;*/
2594 2594
2595 /* With FRAME_MAC_DISPLAY_INFO set up, this unwind-protect is safe. */ 2595 /* With FRAME_MAC_DISPLAY_INFO set up, this unwind-protect is safe. */
2596#if GLYPH_DEBUG 2596#if GLYPH_DEBUG
diff --git a/src/s/darwin.h b/src/s/darwin.h
index 72ed8964a7d..2cc6ef1cdf1 100644
--- a/src/s/darwin.h
+++ b/src/s/darwin.h
@@ -50,12 +50,10 @@ Boston, MA 02110-1301, USA. */
50#ifdef MAC_OSX 50#ifdef MAC_OSX
51#ifdef HAVE_CARBON 51#ifdef HAVE_CARBON
52#define MAC_OS 52#define MAC_OS
53#endif
54#endif
55
56/* We need a little extra space, see ../../lisp/loadup.el. */ 53/* We need a little extra space, see ../../lisp/loadup.el. */
57#define SYSTEM_PURESIZE_EXTRA 30000 54#define SYSTEM_PURESIZE_EXTRA 30000
58 55#endif
56#endif
59 57
60/* SYSTEM_TYPE should indicate the kind of system you are using. 58/* SYSTEM_TYPE should indicate the kind of system you are using.
61 It sets the Lisp variable system-type. */ 59 It sets the Lisp variable system-type. */