Commit e925113b authored by Glenn Morris's avatar Glenn Morris
Browse files

* lisp/term/ns-win.el: Restore require of cl when compiling.

(menu-bar-final-items): Remove non-existent `windows' menu.
parent e617ab06
2010-10-27 Glenn Morris <rgm@gnu.org>
* term/ns-win.el: Restore require of cl when compiling.
(menu-bar-final-items): Remove non-existent `windows' menu.
2010-10-26 Glenn Morris <rgm@gnu.org> 2010-10-26 Glenn Morris <rgm@gnu.org>
   
* term/common-win.el (xw-defined-colors): Simplify the 'ns case. * term/common-win.el (xw-defined-colors): Simplify the 'ns case.
......
...@@ -41,11 +41,12 @@ ...@@ -41,11 +41,12 @@
;;; Code: ;;; Code:
(or (featurep 'ns) (or (featurep 'ns)
(error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS" (error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS"
(invocation-name))) (invocation-name)))
(eval-when-compile (require 'cl)) ; lexical-let
;; Documentation-purposes only: actually loaded in loadup.el ;; Documentation-purposes only: actually loaded in loadup.el
(require 'frame) (require 'frame)
(require 'mouse) (require 'mouse)
...@@ -57,10 +58,6 @@ ...@@ -57,10 +58,6 @@
"GNUstep/Mac OS X specific features." "GNUstep/Mac OS X specific features."
:group 'environment) :group 'environment)
;; nsterm.m
(defvar ns-alternate-modifier)
(defvar ns-right-alternate-modifier)
;;;; Command line argument handling. ;;;; Command line argument handling.
(defvar x-invocation-args) (defvar x-invocation-args)
...@@ -161,7 +158,6 @@ The properties returned may include `top', `left', `height', and `width'." ...@@ -161,7 +158,6 @@ The properties returned may include `top', `left', `height', and `width'."
(define-key global-map [S-mouse-1] 'mouse-save-then-kill) (define-key global-map [S-mouse-1] 'mouse-save-then-kill)
(global-unset-key [S-down-mouse-1]) (global-unset-key [S-down-mouse-1])
;; Special Nextstep-generated events are converted to function keys. Here ;; Special Nextstep-generated events are converted to function keys. Here
;; are the bindings for them. Note, these keys are actually declared in ;; are the bindings for them. Note, these keys are actually declared in
;; x-setup-function-keys in common-win. ;; x-setup-function-keys in common-win.
...@@ -196,10 +192,10 @@ The properties returned may include `top', `left', `height', and `width'." ...@@ -196,10 +192,10 @@ The properties returned may include `top', `left', `height', and `width'."
(setq menu-bar-final-items (setq menu-bar-final-items
(cond ((eq system-type 'darwin) (cond ((eq system-type 'darwin)
'(buffer windows services help-menu)) '(buffer services help-menu))
;; Otherwise, GNUstep. ;; Otherwise, GNUstep.
(t (t
'(buffer windows services hide-app quit)))) '(buffer services hide-app quit))))
;; Add standard top-level items to GNUstep menu. ;; Add standard top-level items to GNUstep menu.
(unless (eq system-type 'darwin) (unless (eq system-type 'darwin)
...@@ -295,10 +291,6 @@ The properties returned may include `top', `left', `height', and `width'." ...@@ -295,10 +291,6 @@ The properties returned may include `top', `left', `height', and `width'."
(t (error (concat "Service " ns-input-spi-name " not recognized"))))) (t (error (concat "Service " ns-input-spi-name " not recognized")))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Composed key sequence handling for Nextstep system input methods. ;; Composed key sequence handling for Nextstep system input methods.
;; (On Nextstep systems, input methods are provided for CJK ;; (On Nextstep systems, input methods are provided for CJK
;; characters, etc. which require multiple keystrokes, and during ;; characters, etc. which require multiple keystrokes, and during
...@@ -395,29 +387,25 @@ See `ns-insert-working-text'." ...@@ -395,29 +387,25 @@ See `ns-insert-working-text'."
;;;; OS X file system Unicode UTF-8 NFD (decomposed form) support ;;;; OS X file system Unicode UTF-8 NFD (decomposed form) support
;; Lisp code based on utf-8m.el, by Seiji Zenitani, Eiji Honjoh, and ;; Lisp code based on utf-8m.el, by Seiji Zenitani, Eiji Honjoh, and
;; Carsten Bormann. ;; Carsten Bormann.
(if (eq system-type 'darwin) (when (eq system-type 'darwin)
(progn (defun ns-utf8-nfd-post-read-conversion (length)
"Calls `ns-convert-utf8-nfd-to-nfc' to compose char sequences."
(defun ns-utf8-nfd-post-read-conversion (length) (save-excursion
"Calls `ns-convert-utf8-nfd-to-nfc' to compose char sequences." (save-restriction
(save-excursion (narrow-to-region (point) (+ (point) length))
(save-restriction (let ((str (buffer-string)))
(narrow-to-region (point) (+ (point) length)) (delete-region (point-min) (point-max))
(let ((str (buffer-string))) (insert (ns-convert-utf8-nfd-to-nfc str))
(delete-region (point-min) (point-max)) (- (point-max) (point-min))
(insert (ns-convert-utf8-nfd-to-nfc str)) ))))
(- (point-max) (point-min))
)))) (define-coding-system 'utf-8-nfd
"UTF-8 NFD (decomposed) encoding."
(define-coding-system 'utf-8-nfd :coding-type 'utf-8
"UTF-8 NFD (decomposed) encoding." :mnemonic ?U
:coding-type 'utf-8 :charset-list '(unicode)
:mnemonic ?U :post-read-conversion 'ns-utf8-nfd-post-read-conversion)
:charset-list '(unicode) (set-file-name-coding-system 'utf-8-nfd))
:post-read-conversion 'ns-utf8-nfd-post-read-conversion)
(set-file-name-coding-system 'utf-8-nfd)))
;;;; Inter-app communications support. ;;;; Inter-app communications support.
...@@ -492,7 +480,6 @@ Lines are highlighted according to `ns-input-line'." ...@@ -492,7 +480,6 @@ Lines are highlighted according to `ns-input-line'."
(add-hook 'first-change-hook 'ns-unselect-line) (add-hook 'first-change-hook 'ns-unselect-line)
;;;; Preferences handling. ;;;; Preferences handling.
(declare-function ns-get-resource "nsfns.m" (owner name)) (declare-function ns-get-resource "nsfns.m" (owner name))
...@@ -567,13 +554,15 @@ unless the current buffer is a scratch buffer." ...@@ -567,13 +554,15 @@ unless the current buffer is a scratch buffer."
(ns-hide-emacs 'activate) (ns-hide-emacs 'activate)
(find-file f))))) (find-file f)))))
;;;; Frame-related functions. ;;;; Frame-related functions.
;; Don't show the frame name; that's redundant with Nextstep. ;; Don't show the frame name; that's redundant with Nextstep.
(setq-default mode-line-frame-identification '(" ")) (setq-default mode-line-frame-identification '(" "))
;; nsterm.m
(defvar ns-alternate-modifier)
(defvar ns-right-alternate-modifier)
;; You say tomAYto, I say tomAHto.. ;; You say tomAYto, I say tomAHto..
(defvaralias 'ns-option-modifier 'ns-alternate-modifier) (defvaralias 'ns-option-modifier 'ns-alternate-modifier)
(defvaralias 'ns-right-option-modifier 'ns-right-alternate-modifier) (defvaralias 'ns-right-option-modifier 'ns-right-alternate-modifier)
...@@ -640,10 +629,8 @@ unless the current buffer is a scratch buffer." ...@@ -640,10 +629,8 @@ unless the current buffer is a scratch buffer."
(if (not tool-bar-mode) (tool-bar-mode t))) (if (not tool-bar-mode) (tool-bar-mode t)))
;;;; Dialog-related functions. ;;;; Dialog-related functions.
;; Ask user for confirm before printing. Due to Kevin Rodgers. ;; Ask user for confirm before printing. Due to Kevin Rodgers.
(defun ns-print-buffer () (defun ns-print-buffer ()
"Interactive front-end to `print-buffer': asks for user confirmation first." "Interactive front-end to `print-buffer': asks for user confirmation first."
...@@ -784,11 +771,9 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") ...@@ -784,11 +771,9 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
;; buffer 0 before retrieving the value of the primary selection. ;; buffer 0 before retrieving the value of the primary selection.
(defun x-selection-value () (defun x-selection-value ()
(let (text) (let (text)
;; Consult the selection. Treat empty strings as if they were unset. ;; Consult the selection. Treat empty strings as if they were unset.
(or text (setq text (ns-get-pasteboard))) (or text (setq text (ns-get-pasteboard)))
(if (string= text "") (setq text nil)) (if (string= text "") (setq text nil))
(cond (cond
((not text) nil) ((not text) nil)
((eq text ns-last-selected-text) nil) ((eq text ns-last-selected-text) nil)
...@@ -809,7 +794,6 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") ...@@ -809,7 +794,6 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(insert (ns-get-cut-buffer-internal 'SECONDARY))) (insert (ns-get-cut-buffer-internal 'SECONDARY)))
;;;; Scrollbar handling. ;;;; Scrollbar handling.
(global-set-key [vertical-scroll-bar down-mouse-1] 'ns-handle-scroll-bar-event) (global-set-key [vertical-scroll-bar down-mouse-1] 'ns-handle-scroll-bar-event)
......
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