summaryrefslogtreecommitdiff
path: root/lisp/frame.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-10-21 11:27:18 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-10-21 11:27:18 -0400
commita046b8dd48b0e26f9354e9a005113088c3bc04f9 (patch)
tree608344bb89046a967dcae461b2bde45900c28af5 /lisp/frame.el
parente5b3b7d3f387c992e6507bef3885056c5235e9ee (diff)
downloademacs-a046b8dd48b0e26f9354e9a005113088c3bc04f9.tar.gz
emacs-a046b8dd48b0e26f9354e9a005113088c3bc04f9.tar.bz2
emacs-a046b8dd48b0e26f9354e9a005113088c3bc04f9.zip
Get rid of backend-dependent selection-handling functions for kill/yank
and make it generic instead by relying on the lower-level selection management functions. * select.el (select-enable-clipboard): Rename from gui-select-enable-clipboard. (select-enable-primary): Move from x-win.el and rename from x-select-enable-primary. (gui-last-selected-text): Remove. (gui--last-selected-text-clipboard, gui--last-selected-text-primary): New vars. (gui-select-text): Rewrite, based on x-win.el's old x-select-text. (gui-select-text-alist, gui-selection-value-alist): Remove. (x-select-request-type): Move from x-win.el. (gui--selection-value-internal): New function, taken from x-win's x-selection-value-internal. (gui-selection-value): Rewrite, based on x-win.el's old x-selection-value. (gui-set-selection-alist): Rename from gui-own-selection-alist and extend it to handle a nil value as a "disown" request. (gui-disown-selection-alist): Remove. (xselect-convert-to-delete): Adjust accordingly. (gui-set-selection): Simplify accordingly as well. Use dotimes. * lisp/frame.el (gui-method): Use window-system rather than framep. (gui-method-declare): The tty case is now nil rather than t. (make-frame): Adjust accordingly. * lisp/term/x-win.el (x-last-selected-text-primary) (x-select-enable-primary): Remove (moved to select.el). (x-select-request-type): Move to select.el. (x-selection-value-internal, x--selection-value): Remove functions. (gui-selection-value, gui-select-text): Remove moethods. (gui-set-selection): Merge own and disown methods. * lisp/startup.el (command-line): Adjust now that `gui-method' expects nil for ttys. * lisp/term/ns-win.el (ns-get-pasteboard, ns-set-pasteboard) (ns-selection-value): Remove functions. (gui-select-text, gui-selection-value): Don't define method any more. (gui-set-selection): Merge the old own and disown methods. (gui-selection-exists-p, gui-get-selection): Adjust to new name of underlying C primitive. * lisp/term/pc-win.el (w16-get-selection-value): Add dummy argument and drop test of gui-select-enable-clipboard, to make it usable as a gui-get-selection method. (gui-selection-exists-p): Adjust to new name of C primitive. (gui-set-selection): Merge own and disown methods. (gui-select-text, gui-selection-value): Delete methods. (w16--select-text): Delete function. * lisp/term/w32-win.el (w32--select-text, w32--get-selection-value): Delete function (move functionality into w32--set-selection and w32--get-selection). (gui-select-text, gui-selection-value): Don't define methods. (w32--set-selection, w32--get-selection, w32--selection-owner-p): New functions. (gui-get-selection, gui-selection-owner-p, gui-selection-exists-p): Use them. (gui-selection-exists-p): Adjust to new name of C primitive. * src/nsselect.m (ns_get_local_selection): Signal error rather than `quit'. (Fns_own_selection_internal): Tighten scoping. (Fns_selection_exists_p): Rename from Fx_selection_exists_p. (Fns_get_selection): Rename from Fx_get_selection_internal. (Fns_get_selection_internal, Fns_store_selection_internal): Remove functions. (syms_of_nsselect): Adjust accordingly. * src/w16select.c (Fw16_selection_exists_p): Rename from Fx_selection_exists_p. (syms_of_win16select): Adjust accordingly. * src/w32select.c (Fw32_selection_exists_p): Rename from Fx_selection_exists_p. (syms_of_w32select): Adjust accordingly.
Diffstat (limited to 'lisp/frame.el')
-rw-r--r--lisp/frame.el37
1 files changed, 18 insertions, 19 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index 952a3568156..9ee86367adc 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -32,7 +32,7 @@
(intern (format "%s-alist" base)))
(defmacro gui-method (name &optional type)
- (macroexp-let2 nil type (or type `(framep (selected-frame)))
+ (macroexp-let2 nil type (or type `window-system)
`(alist-get ,type ,(gui-method--name name)
(lambda (&rest _args)
(error "No method %S for %S frame" ',name ,type)))))
@@ -43,7 +43,7 @@
(defmacro gui-method-declare (name &optional tty-fun doc)
(declare (doc-string 3) (indent 2))
`(defvar ,(gui-method--name name)
- ,(if tty-fun `(list (cons t ,tty-fun))) ,doc))
+ ,(if tty-fun `(list (cons nil ,tty-fun))) ,doc))
(defmacro gui-call (name &rest args)
`(funcall (gui-method ,name) ,@args))
@@ -646,23 +646,22 @@ frame the selected frame. However, the window system may select
the new frame according to its own rules."
(interactive)
(let* ((display (cdr (assq 'display parameters)))
- (w (or
- (cond
- ((assq 'terminal parameters)
- (let ((type (terminal-live-p
- (cdr (assq 'terminal parameters)))))
- (cond
- ((null type) (error "Terminal %s does not exist"
- (cdr (assq 'terminal parameters))))
- (t type))))
- ((assq 'window-system parameters)
- (cdr (assq 'window-system parameters)))
- (display
- (or (window-system-for-display display)
- (error "Don't know how to interpret display %S"
- display)))
- (t window-system))
- t))
+ (w (cond
+ ((assq 'terminal parameters)
+ (let ((type (terminal-live-p
+ (cdr (assq 'terminal parameters)))))
+ (cond
+ ((eq t type) nil)
+ ((null type) (error "Terminal %s does not exist"
+ (cdr (assq 'terminal parameters))))
+ (t type))))
+ ((assq 'window-system parameters)
+ (cdr (assq 'window-system parameters)))
+ (display
+ (or (window-system-for-display display)
+ (error "Don't know how to interpret display %S"
+ display)))
+ (t window-system)))
(oldframe (selected-frame))
(params parameters)
frame)