X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/7c420169baa7c50428589cca7f8eda71b462eb15..c803b2b767f8ed06beb28106a03f23bc577cfdae:/lisp/term/ns-win.el diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index 77a2d3f2bc..df0ddd7de8 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -1,7 +1,6 @@ ;;; ns-win.el --- lisp side of interface with NeXT/Open/GNUstep/MacOS X window system -;; Copyright (C) 1993, 1994, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1993-1994, 2005-2011 Free Software Foundation, Inc. ;; Authors: Carl Edman ;; Christian Limpach @@ -151,8 +150,8 @@ The properties returned may include `top', `left', `height', and `width'." (define-key global-map [end] 'end-of-buffer) (define-key global-map [kp-home] 'beginning-of-buffer) (define-key global-map [kp-end] 'end-of-buffer) -(define-key global-map [kp-prior] 'scroll-down) -(define-key global-map [kp-next] 'scroll-up) +(define-key global-map [kp-prior] 'scroll-down-command) +(define-key global-map [kp-next] 'scroll-up-command) ;; Allow shift-clicks to work similarly to under Nextstep. (define-key global-map [S-mouse-1] 'mouse-save-then-kill) @@ -488,10 +487,12 @@ unless the current buffer is a scratch buffer." (defun ns-find-file () "Do a `find-file' with the `ns-input-file' as argument." (interactive) - (let* ((f (file-truename (pop ns-input-file))) + (let* ((f (file-truename + (expand-file-name (pop ns-input-file) + command-line-default-directory))) (file (find-file-noselect f)) (bufwin1 (get-buffer-window file 'visible)) - (bufwin2 (get-buffer-window "*scratch*" 'visibile))) + (bufwin2 (get-buffer-window "*scratch*" 'visible))) (cond (bufwin1 (select-frame (window-frame bufwin1)) @@ -512,9 +513,6 @@ unless the current buffer is a scratch buffer." ;;;; Frame-related functions. -;; Don't show the frame name; that's redundant with Nextstep. -(setq-default mode-line-frame-identification '(" ")) - ;; nsterm.m (defvar ns-alternate-modifier) (defvar ns-right-alternate-modifier) @@ -664,7 +662,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (defvar ns-reg-to-script) ; nsfont.m ;; This maps font registries (not exposed by NS APIs for font selection) to -;; unicode scripts (which can be mapped to unicode character ranges which are). +;; Unicode scripts (which can be mapped to Unicode character ranges which are). ;; See ../international/fontset.el (setq ns-reg-to-script '(("iso8859-1" . latin) @@ -704,19 +702,24 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") ;;;; Pasteboard support. -(declare-function ns-get-cut-buffer-internal "nsselect.m" (buffer)) +(declare-function ns-get-selection-internal "nsselect.m" (buffer)) +(declare-function ns-store-selection-internal "nsselect.m" (buffer string)) + +(define-obsolete-function-alias 'ns-get-cut-buffer-internal + 'ns-get-selection-internal "24.1") +(define-obsolete-function-alias 'ns-store-cut-buffer-internal + 'ns-store-selection-internal "24.1") + (defun ns-get-pasteboard () "Returns the value of the pasteboard." - (ns-get-cut-buffer-internal 'CLIPBOARD)) - -(declare-function ns-store-cut-buffer-internal "nsselect.m" (buffer string)) + (ns-get-selection-internal 'CLIPBOARD)) (defun ns-set-pasteboard (string) "Store STRING into the pasteboard of the Nextstep display server." ;; Check the data type of STRING. (if (not (stringp string)) (error "Nonstring given to pasteboard")) - (ns-store-cut-buffer-internal 'CLIPBOARD string)) + (ns-store-selection-internal 'CLIPBOARD string)) ;; We keep track of the last text selected here, so we can check the ;; current selection against it, and avoid passing back our own text @@ -744,11 +747,11 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (defun ns-copy-including-secondary () (interactive) (call-interactively 'kill-ring-save) - (ns-store-cut-buffer-internal 'SECONDARY - (buffer-substring (point) (mark t)))) + (ns-store-selection-internal 'SECONDARY + (buffer-substring (point) (mark t)))) (defun ns-paste-secondary () (interactive) - (insert (ns-get-cut-buffer-internal 'SECONDARY))) + (insert (ns-get-selection-internal 'SECONDARY))) ;;;; Scrollbar handling. @@ -891,6 +894,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (declare-function ns-list-services "nsfns.m" ()) (declare-function x-open-connection "nsfns.m" (display &optional xrm-string must-succeed)) +(declare-function ns-set-resource "nsfns.m" (owner name value)) ;; Do the actual Nextstep Windows setup here; the above code just ;; defines functions and variables that we use now. @@ -915,6 +919,11 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") ;; FIXME: This will surely lead to "MODIFIED OUTSIDE CUSTOM" warnings. (menu-bar-mode (if (get-lisp-resource nil "Menus") 1 -1)) + ;; OS X Lion introduces PressAndHold, which is unsupported by this port. + ;; See this thread for more details: + ;; http://lists.gnu.org/archive/html/emacs-devel/2011-06/msg00505.html + (ns-set-resource nil "ApplePressAndHoldEnabled" "NO") + (setq ns-initialized t)) (add-to-list 'handle-args-function-alist '(ns . x-handle-args))