emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/term/mac-win.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/term/mac-win.el,v
Date: Wed, 29 Aug 2007 05:28:35 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     07/08/29 05:28:10

Index: lisp/term/mac-win.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/mac-win.el,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -b -r1.94 -r1.95
--- lisp/term/mac-win.el        27 Aug 2007 08:30:13 -0000      1.94
+++ lisp/term/mac-win.el        29 Aug 2007 05:28:00 -0000      1.95
@@ -65,8 +65,8 @@
 ;; An alist of X options and the function which handles them.  See
 ;; ../startup.el.
 
-(if (not (eq window-system 'mac))
-    (error "%s: Loading mac-win.el but not compiled for Mac" 
(invocation-name)))
+;; (if (not (eq window-system 'mac))
+;;     (error "%s: Loading mac-win.el but not compiled for Mac" 
(invocation-name)))
 
 (require 'frame)
 (require 'mouse)
@@ -1062,22 +1062,25 @@
 (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 function-key-map [backspace] [?\d])
-(define-key function-key-map [delete] [?\d])
-(define-key function-key-map [tab] [?\t])
-(define-key function-key-map [linefeed] [?\n])
-(define-key function-key-map [clear] [?\C-l])
-(define-key function-key-map [return] [?\C-m])
-(define-key function-key-map [escape] [?\e])
-(define-key function-key-map [M-backspace] [?\M-\d])
-(define-key function-key-map [M-delete] [?\M-\d])
-(define-key function-key-map [M-tab] [?\M-\t])
-(define-key function-key-map [M-linefeed] [?\M-\n])
-(define-key function-key-map [M-clear] [?\M-\C-l])
-(define-key function-key-map [M-return] [?\M-\C-m])
-(define-key function-key-map [M-escape] [?\M-\e])
+(define-key local-function-key-map [backspace] [?\d])
+(define-key local-function-key-map [delete] [?\d])
+(define-key local-function-key-map [tab] [?\t])
+(define-key local-function-key-map [linefeed] [?\n])
+(define-key local-function-key-map [clear] [?\C-l])
+(define-key local-function-key-map [return] [?\C-m])
+(define-key local-function-key-map [escape] [?\e])
+(define-key local-function-key-map [M-backspace] [?\M-\d])
+(define-key local-function-key-map [M-delete] [?\M-\d])
+(define-key local-function-key-map [M-tab] [?\M-\t])
+(define-key local-function-key-map [M-linefeed] [?\M-\n])
+(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.
@@ -2294,34 +2297,6 @@
          (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")
@@ -2499,6 +2474,88 @@
     (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
@@ -2605,50 +2662,7 @@
        (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"))
-(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)
-
-(defalias 'x-cut-buffer-or-selection-value '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)
   "Handle scroll bar EVENT to emulate Mac Toolbox style scrolling."
@@ -2696,7 +2710,6 @@
     (mac-scroll-ignore-events)
     (scroll-up 1)))
 
-)
 
 
 ;;;; Others
@@ -2734,5 +2747,11 @@
 ;; or bold bitmap versions will not display these variants correctly.
 (setq scalable-fonts-allowed t)
 
+(add-to-list 'handle-args-function-alist '(mac . x-handle-args))
+(add-to-list 'frame-creation-function-alist '(mac . x-create-frame-with-faces))
+(add-to-list 'window-system-initialization-alist '(mac . 
mac-initialize-window-system))
+
+(provide 'mac-win)
+
 ;; arch-tag: 71dfcd14-cde8-4d66-b05c-85ec94fb23a6
 ;;; mac-win.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]