;;; pc-win.el --- setup support for `PC windows' (whatever that is) -*- lexical-binding:t -*-
-;; Copyright (C) 1994, 1996-1997, 1999, 2001-2015 Free Software
+;; Copyright (C) 1994, 1996-1997, 1999, 2001-2016 Free Software
;; Foundation, Inc.
;; Author: Morten Welinder <terra@diku.dk>
PATTERN is case-insensitive.
The return value is a list of strings, suitable as arguments to
-\`set-face-font'.
+`set-face-font'.
Fonts Emacs can't use may or may not be excluded
even if they match PATTERN and FACE.
;; From lisp/term/w32-win.el
;
;;;; Selections
-;
-(defun w16-get-selection-value (_selection-symbol _target-type)
+
+;; gui-get-selection is used in select.el
+(cl-defmethod gui-backend-get-selection (_selection-symbol _target-type
+ &context (window-system pc))
"Return the value of the current selection.
Consult the selection. Treat empty strings as if they were unset."
;; Don't die if x-get-selection signals an error.
(declare-function w16-selection-exists-p "w16select.c")
;; gui-selection-owner-p is used in simple.el.
-(gui-method-define gui-selection-exists-p pc #'w16-selection-exists-p)
-(gui-method-define gui-selection-owner-p pc #'w16-selection-owner-p)
+(cl-defmethod gui-backend-selection-exists-p (selection
+ &context (window-system pc))
+ (w16-selection-exists-p selection))
+
+(cl-defmethod gui-backend-selection-owner-p (selection
+ &context (window-system pc))
+ (w16-selection-owner-p selection))
(defun w16-selection-owner-p (_selection)
;; FIXME: Other systems don't obey select-enable-clipboard here.
;; gui-set-selection is used in gui-set-selection.
(declare-function w16-set-clipboard-data "w16select.c"
(string &optional ignored))
-(gui-method-define gui-set-selection pc
- (lambda (selection value)
- (if (not value)
- (if (w16-selection-owner-p selection)
- t)
- ;; FIXME: Other systems don't obey
- ;; gui-select-enable-clipboard here.
- (with-demoted-errors "w16-set-clipboard-data: %S"
- (w16-set-clipboard-data value))
- value)))
-
-;; gui-get-selection is used in select.el
-(gui-method-define gui-get-selection pc #'w16-get-selection-value)
+(cl-defmethod gui-backend-set-selection (selection value
+ &context (window-system pc))
+ (if (not value)
+ (if (w16-selection-owner-p selection)
+ t)
+ ;; FIXME: Other systems don't obey
+ ;; gui-select-enable-clipboard here.
+ (with-demoted-errors "w16-set-clipboard-data: %S"
+ (w16-set-clipboard-data value))
+ value))
;; From src/fontset.c:
(fset 'query-fontset 'ignore)
;; Initialization.
;; ---------------------------------------------------------------------------
-;; This function is run, by faces.el:tty-create-frame-with-faces, only
-;; for the initial frame (on each terminal, but we have only one).
+;; This function is run, by the tty method of `frame-creation-function'
+;; (in faces.el), only for the initial frame (on each terminal, but we have
+;; only one).
;; This works by setting the `terminal-initted' terminal parameter to
-;; this function, the first time `tty-create-frame-with-faces' is
-;; called on that terminal. `tty-create-frame-with-faces' is called
-;; directly from startup.el and also by `make-frame' through
-;; `frame-creation-function-alist'. `make-frame' will call this
-;; function if `msdos-create-frame-with-faces' (see below) is not
-;; found in `frame-creation-function-alist', which means something is
+;; this function, the first time `frame-creation-function' is
+;; called on that terminal. `frame-creation-function' is called
+;; directly from startup.el and also by `make-frame'.
+;; `make-frame' should call our own `frame-creation-function' method instead
+;; (see below) so if terminal-init-internal is called it means something is
;; _very_ wrong, because "internal" terminal emulator should not be
;; turned on if our window-system is not `pc'. Therefore, the only
;; Right Thing for us to do here is scream bloody murder.
(error "terminal-init-internal called for window-system `%s'"
(window-system)))
-(defun msdos-initialize-window-system (&optional _display)
+;; window-system-initialization is called by startup.el:command-line.
+(cl-defmethod window-system-initialization (&context (window-system pc)
+ &optional _display)
"Initialization function for the `pc' \"window system\"."
(or (eq (window-system) 'pc)
(error
(menu-bar-enable-clipboard)
(run-hooks 'terminal-init-msdos-hook))
-;; frame-creation-function-alist is examined by frame.el:make-frame.
-(gui-method-define frame-creation-function
- pc #'msdos-create-frame-with-faces)
-;; window-system-initialization-alist is examined by startup.el:command-line.
-(gui-method-define window-system-initialization
- pc #'msdos-initialize-window-system)
+;; frame-creation-function is called by frame.el:make-frame.
+(cl-defmethod frame-creation-function (params &context (window-system pc))
+ (msdos-create-frame-with-faces params))
+
;; We don't need anything beyond tty-handle-args for handling
;; command-line argument; see startup.el.
-(gui-method-define handle-args-function pc #'tty-handle-args)
-
-
+(cl-defmethod handle-args-function (args &context (window-system pc))
+ (tty-handle-args args))
;; ---------------------------------------------------------------------------
(provide 'pc-win)
+(provide 'term/pc-win)
;;; pc-win.el ends here