summaryrefslogtreecommitdiff
path: root/lisp/term
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/common-win.el2
-rw-r--r--lisp/term/iris-ansi.el2
-rw-r--r--lisp/term/lk201.el2
-rw-r--r--lisp/term/ns-win.el44
-rw-r--r--lisp/term/pc-win.el2
-rw-r--r--lisp/term/rxvt.el2
-rw-r--r--lisp/term/sun.el1
-rw-r--r--lisp/term/tvi970.el2
-rw-r--r--lisp/term/w32-win.el58
-rw-r--r--lisp/term/wyse50.el2
-rw-r--r--lisp/term/x-win.el5
-rw-r--r--lisp/term/xterm.el2
12 files changed, 80 insertions, 44 deletions
diff --git a/lisp/term/common-win.el b/lisp/term/common-win.el
index 067b996d1ff..b44e092cc0a 100644
--- a/lisp/term/common-win.el
+++ b/lisp/term/common-win.el
@@ -57,7 +57,7 @@ clipboard as well.
On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard'
is not used)."
- (cond ((eq system-type 'windows-nt)
+ (cond ((eq (framep (selected-frame)) 'w32)
(if x-select-enable-clipboard
(w32-set-clipboard-data text))
(setq x-last-selected-text text))
diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el
index 9a9a31f4253..aea2e8c1092 100644
--- a/lisp/term/iris-ansi.el
+++ b/lisp/term/iris-ansi.el
@@ -322,7 +322,7 @@
"Terminal initialization function for iris-ansi."
;; Use inheritance to let the main keymap override these defaults.
;; This way we don't override terminfo-derived settings or settings
- ;; made in the .emacs file.
+ ;; made in the init file.
(let ((m (copy-keymap iris-function-map)))
(set-keymap-parent m (keymap-parent input-decode-map))
(set-keymap-parent input-decode-map m)))
diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el
index 76a3a31cedc..6b9e1301003 100644
--- a/lisp/term/lk201.el
+++ b/lisp/term/lk201.el
@@ -75,7 +75,7 @@
(defun terminal-init-lk201 ()
;; Use inheritance to let the main keymap override these defaults.
;; This way we don't override terminfo-derived settings or settings
- ;; made in the .emacs file.
+ ;; made in the init file.
(let ((m (copy-keymap lk201-function-map)))
(set-keymap-parent m (keymap-parent input-decode-map))
(set-keymap-parent input-decode-map m)))
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 06b67475c1d..e255fec1240 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -39,7 +39,7 @@
;; this file, which works in close coordination with src/nsfns.m.
;;; Code:
-
+(eval-when-compile (require 'cl-lib))
(or (featurep 'ns)
(error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS"
(invocation-name)))
@@ -448,10 +448,21 @@ Lines are highlighted according to `ns-input-line'."
;; nsterm.m
(declare-function ns-read-file-name "nsfns.m"
- (prompt &optional dir isLoad init))
+ (prompt &optional dir mustmatch init dir_only_p))
;;;; File handling.
+(defun x-file-dialog (prompt dir default_filename mustmatch only_dir_p)
+"Read file name, prompting with PROMPT in directory DIR.
+Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file
+selection box, if specified. If MUSTMATCH is non-nil, the returned file
+or directory must exist.
+
+This function is only defined on NS, MS Windows, and X Windows with the
+Motif or Gtk toolkits. With the Motif toolkit, ONLY-DIR-P is ignored.
+Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories."
+ (ns-read-file-name prompt dir mustmatch default_filename only_dir_p))
+
(defun ns-open-file-using-panel ()
"Pop up open-file panel, and load the result in a buffer."
(interactive)
@@ -622,8 +633,9 @@ This function has been overloaded in Nextstep.")
`ns-input-fontsize' of new font."
(interactive)
(modify-frame-parameters (selected-frame)
- (list (cons 'font ns-input-font)
- (cons 'fontsize ns-input-fontsize)))
+ (list (cons 'fontsize ns-input-fontsize)))
+ (modify-frame-parameters (selected-frame)
+ (list (cons 'font ns-input-font)))
(set-frame-font ns-input-font))
@@ -644,18 +656,6 @@ This defines a fontset consisting of the Courier and other fonts that
come with OS X.
See the documentation of `create-fontset-from-fontset-spec' for the format.")
-;; Conditional on new-fontset so bootstrapping works on non-GUI compiles.
-(when (fboundp 'new-fontset)
- ;; Setup the default fontset.
- (create-default-fontset)
- ;; Create the standard fontset.
- (condition-case err
- (create-fontset-from-fontset-spec ns-standard-fontset-spec t)
- (error (display-warning
- 'initialization
- (format "Creation of the standard fontset failed: %s" err)
- :error))))
-
(defvar ns-reg-to-script) ; nsfont.m
;; This maps font registries (not exposed by NS APIs for font selection) to
@@ -897,10 +897,21 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
;; defines functions and variables that we use now.
(defun ns-initialize-window-system ()
"Initialize Emacs for Nextstep (Cocoa / GNUstep) windowing."
+ (cl-assert (not ns-initialized))
;; PENDING: not needed?
(setq command-line-args (x-handle-args command-line-args))
+ ;; Setup the default fontset.
+ (create-default-fontset)
+ ;; Create the standard fontset.
+ (condition-case err
+ (create-fontset-from-fontset-spec ns-standard-fontset-spec t)
+ (error (display-warning
+ 'initialization
+ (format "Creation of the standard fontset failed: %s" err)
+ :error)))
+
(x-open-connection (system-name) nil t)
(dolist (service (ns-list-services))
@@ -924,6 +935,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(x-apply-session-resources)
(setq ns-initialized t))
+(add-to-list 'display-format-alist '("\\`ns\\'" . ns))
(add-to-list 'handle-args-function-alist '(ns . x-handle-args))
(add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces))
(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el
index b460e3b8a14..9fd3bf14fe1 100644
--- a/lisp/term/pc-win.el
+++ b/lisp/term/pc-win.el
@@ -40,8 +40,6 @@
(error "%s: Loading pc-win.el but not compiled for MS-DOS"
(invocation-name)))
-(load "term/internal" nil t)
-
(declare-function msdos-remember-default-colors "msdos.c")
(declare-function w16-set-clipboard-data "w16select.c")
(declare-function w16-get-clipboard-data "w16select.c")
diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el
index 481d6b498cf..98141563006 100644
--- a/lisp/term/rxvt.el
+++ b/lisp/term/rxvt.el
@@ -166,7 +166,7 @@
;; Use inheritance to let the main keymap override those defaults.
;; This way we don't override terminfo-derived settings or settings
- ;; made in the .emacs file.
+ ;; made in the init file.
(let ((m (copy-keymap rxvt-function-map)))
(set-keymap-parent m (keymap-parent input-decode-map))
(set-keymap-parent input-decode-map m))
diff --git a/lisp/term/sun.el b/lisp/term/sun.el
index 4bd22c1d8da..dfe7a63ac1b 100644
--- a/lisp/term/sun.el
+++ b/lisp/term/sun.el
@@ -123,6 +123,7 @@
(defvar sun-raw-prefix-hooks nil
"List of forms to evaluate after setting sun-raw-prefix.")
+(make-obsolete-variable 'sun-raw-prefix-hooks 'term-setup-hook "21.1")
diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el
index b02d39c1e0f..f1b6eea8875 100644
--- a/lisp/term/tvi970.el
+++ b/lisp/term/tvi970.el
@@ -93,7 +93,7 @@
"Terminal initialization function for tvi970."
;; Use inheritance to let the main keymap override these defaults.
;; This way we don't override terminfo-derived settings or settings
- ;; made in the .emacs file.
+ ;; made in the init file.
(let ((m (copy-keymap tvi970-terminal-map)))
(set-keymap-parent m (keymap-parent input-decode-map))
(set-keymap-parent input-decode-map m))
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index a4fac3441db..95dab10101b 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -1,4 +1,4 @@
-;;; w32-win.el --- parse switches controlling interface with W32 window system
+;;; w32-win.el --- parse switches controlling interface with W32 window system -*- lexical-binding: t -*-
;; Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
@@ -68,6 +68,7 @@
;; (if (not (eq window-system 'w32))
;; (error "%s: Loading w32-win.el but not compiled for w32" (invocation-name)))
+(eval-when-compile (require 'cl-lib))
(require 'frame)
(require 'mouse)
(require 'scroll-bar)
@@ -88,7 +89,10 @@
(make-obsolete 'w32-default-color-map nil "24.1")
(declare-function w32-send-sys-command "w32fns.c")
-(declare-function set-message-beep "w32console.c")
+(declare-function set-message-beep "w32fns.c")
+
+(declare-function cygwin-convert-file-name-from-windows "cygw32.c"
+ (path &optional absolute_p))
;; Conditional on new-fontset so bootstrapping works on non-GUI compiles
(if (fboundp 'new-fontset)
@@ -102,7 +106,26 @@
;; (interactive "e")
;; (princ event))
-(defun w32-drag-n-drop (event)
+(defun w32-handle-dropped-file (window file-name)
+ (let ((f (if (eq system-type 'cygwin)
+ (cygwin-convert-file-name-from-windows file-name t)
+ (subst-char-in-string ?\\ ?/ file-name)))
+ (coding (or file-name-coding-system
+ default-file-name-coding-system)))
+
+ (setq file-name
+ (mapconcat 'url-hexify-string
+ (split-string (encode-coding-string f coding)
+ "/")
+ "/")))
+ (dnd-handle-one-url window 'private
+ (concat
+ (if (eq system-type 'cygwin)
+ "file://"
+ "file:")
+ file-name)))
+
+(defun w32-drag-n-drop (event &optional new-frame)
"Edit the files listed in the drag-n-drop EVENT.
Switch to a buffer editing the last file dropped."
(interactive "e")
@@ -116,26 +139,21 @@ Switch to a buffer editing the last file dropped."
(y (cdr coords)))
(if (and (> x 0) (> y 0))
(set-frame-selected-window nil window))
- (mapc (lambda (file-name)
- (let ((f (subst-char-in-string ?\\ ?/ file-name))
- (coding (or file-name-coding-system
- default-file-name-coding-system)))
- (setq file-name
- (mapconcat 'url-hexify-string
- (split-string (encode-coding-string f coding)
- "/")
- "/")))
- (dnd-handle-one-url window 'private
- (concat "file:" file-name)))
- (car (cdr (cdr event)))))
- (raise-frame)))
+
+ (when new-frame
+ (select-frame (make-frame)))
+ (raise-frame)
+ (setq window (selected-window))
+
+ (mapc (apply-partially #'w32-handle-dropped-file window)
+ (car (cdr (cdr event)))))))
(defun w32-drag-n-drop-other-frame (event)
"Edit the files listed in the drag-n-drop EVENT, in other frames.
May create new frames, or reuse existing ones. The frame editing
the last file dropped is selected."
(interactive "e")
- (mapcar 'find-file-other-frame (car (cdr (cdr event)))))
+ (w32-drag-n-drop event t))
;; Bind the drag-n-drop event.
(global-set-key [drag-n-drop] 'w32-drag-n-drop)
@@ -230,6 +248,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(defun w32-initialize-window-system ()
"Initialize Emacs for W32 GUI frames."
+ (cl-assert (not w32-initialized))
;; Do the actual Windows setup here; the above code just defines
;; functions and variables that we use now.
@@ -243,7 +262,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
;; so as not to choke when we use it in X resource queries.
(replace-regexp-in-string "[.*]" "-" (invocation-name))))
- (x-open-connection "" x-command-line-resources
+ (x-open-connection "w32" x-command-line-resources
;; Exit with a fatal error if this fails and we
;; are the initial display
(eq initial-window-system 'w32))
@@ -294,7 +313,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(setq default-frame-alist
(cons '(reverse . t) default-frame-alist)))))
- ;; Don't let Emacs suspend under w32 gui
+ ;; Don't let Emacs suspend under Windows.
(add-hook 'suspend-hook 'x-win-suspend-error)
;; Turn off window-splitting optimization; w32 is usually fast enough
@@ -312,6 +331,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(x-apply-session-resources)
(setq w32-initialized t))
+(add-to-list 'display-format-alist '("\\`w32\\'" . w32))
(add-to-list 'handle-args-function-alist '(w32 . x-handle-args))
(add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces))
(add-to-list 'window-system-initialization-alist '(w32 . w32-initialize-window-system))
diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el
index d037962af19..ce148b62dba 100644
--- a/lisp/term/wyse50.el
+++ b/lisp/term/wyse50.el
@@ -109,7 +109,7 @@
"Terminal initialization function for wyse50."
;; Use inheritance to let the main keymap override these defaults.
;; This way we don't override terminfo-derived settings or settings
- ;; made in the .emacs file.
+ ;; made in the init file.
(let ((m (copy-keymap wyse50-terminal-map)))
(set-keymap-parent m (keymap-parent input-decode-map))
(set-keymap-parent input-decode-map m))
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 9b7254cd132..2f2125a31db 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -67,6 +67,8 @@
;; An alist of X options and the function which handles them. See
;; ../startup.el.
+(eval-when-compile (require 'cl-lib))
+
(if (not (fboundp 'x-create-frame))
(error "%s: Loading x-win.el but not compiled for X" (invocation-name)))
@@ -1338,6 +1340,8 @@ Request data types in the order specified by `x-select-request-type'."
(defun x-initialize-window-system ()
"Initialize Emacs for X frames and open the first connection to an X server."
+ (cl-assert (not x-initialized))
+
;; Make sure we have a valid resource name.
(or (stringp x-resource-name)
(let (i)
@@ -1451,6 +1455,7 @@ Request data types in the order specified by `x-select-request-type'."
(x-apply-session-resources)
(setq x-initialized t))
+(add-to-list 'display-format-alist '("\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" . x))
(add-to-list 'handle-args-function-alist '(x . x-handle-args))
(add-to-list 'frame-creation-function-alist '(x . x-create-frame-with-faces))
(add-to-list 'window-system-initialization-alist '(x . x-initialize-window-system))
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 28fb9da0b9d..e4871658b98 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -480,7 +480,7 @@ The relevant features are:
;; Use inheritance to let the main keymap override those defaults.
;; This way we don't override terminfo-derived settings or settings
- ;; made in the .emacs file.
+ ;; made in the init file.
(set-keymap-parent map (keymap-parent input-decode-map))
(set-keymap-parent input-decode-map map)))