diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-05-23 11:32:29 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-05-23 11:32:29 -0400 |
commit | 919281ddb2eec5b5503c246dfad902d44aa25644 (patch) | |
tree | 1204a207b7d24c596caed1beeda629c27ba2f90d /src/nsselect.m | |
parent | dc4484ec6de13a3d75b52c477a3cde59dc8ed46c (diff) |
Replace gui-method macros with cl-generic with &context
* lisp/frame.el (gui-method--name, gui-method, gui-method-define)
(gui-method-declare, gui-call): Remove.
(frame-creation-function): Use cl-defgeneric.
(make-frame): Adjust callers.
* lisp/menu-bar.el (menu-bar-edit-menu):
Use gui-backend-selection-exists-p.
* lisp/select.el (x-get-clipboard): Use gui-backend-get-selection.
(gui-backend-get-selection): New cl-generic to replace
gui-get-selection method.
(gui-backend-set-selection): New cl-generic to replace
gui-set-selection method.
(gui-selection-owner-p): New cl-generic to replace
gui-selection-owner-p method.
(gui-backend-selection-exists-p): New cl-generic to replace
gui-selection-exists-p method. Adjust all callers.
* lisp/server.el (server-create-window-system-frame): Don't ignore
window-system spec even when unsupported.
* lisp/simple.el (deactivate-mark): Use new gui-backend-* functions.
* lisp/startup.el (handle-args-function, window-system-initialization):
Use cl-defgeneric.
(command-line): Adjust calls accordingly.
* lisp/term/ns-win.el (ns-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/pc-win.el (w16-get-selection-value): Turn into
a gui-backend-get-selection method.
(gui-selection-exists-p, gui-selection-owner-p, gui-set-selection):
Use cl-defmethod on the new functions instead.
(msdos-window-system-initialization): Turn into
a window-system-initialization method.
(frame-creation-function, handle-args-function): Use cl-defmethod.
* lisp/term/w32-win.el (w32-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/x-win.el (x-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/xterm.el (xterm--set-selection): Turn into
a gui-backend-set-selection method.
* src/nsselect.m (Fns_selection_exists_p): Remove unused arg `terminal'.
(Fns_selection_owner_p): Remove unused arg `terminal'.
(Fns_get_selection): Remove unused args `time_stamp' and `terminal'.
Diffstat (limited to 'src/nsselect.m')
-rw-r--r-- | src/nsselect.m | 60 |
1 files changed, 19 insertions, 41 deletions
diff --git a/src/nsselect.m b/src/nsselect.m index 1544b16dc9d..918fb55fb22 100644 --- a/src/nsselect.m +++ b/src/nsselect.m @@ -385,18 +385,12 @@ Disowning it means there is no such selection. */) DEFUN ("ns-selection-exists-p", Fns_selection_exists_p, Sns_selection_exists_p, - 0, 2, 0, doc: /* Whether there is an owner for the given X selection. + 0, 1, 0, doc: /* Whether there is an owner for the given X selection. SELECTION should be the name of the selection in question, typically one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. (X expects these literal upper-case names.) The symbol nil is the same as -`PRIMARY', and t is the same as `SECONDARY'. - -TERMINAL should be a terminal object or a frame specifying the X -server to query. If omitted or nil, that stands for the selected -frame's display, or the first available X display. - -On Nextstep, TERMINAL is unused. */) - (Lisp_Object selection, Lisp_Object terminal) +`PRIMARY', and t is the same as `SECONDARY'. */) + (Lisp_Object selection) { id pb; NSArray *types; @@ -416,20 +410,14 @@ On Nextstep, TERMINAL is unused. */) DEFUN ("ns-selection-owner-p", Fns_selection_owner_p, Sns_selection_owner_p, - 0, 2, 0, + 0, 1, 0, doc: /* Whether the current Emacs process owns the given X Selection. The arg should be the name of the selection in question, typically one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. \(Those are literal upper-case symbol names, since that's what X expects.) For convenience, the symbol nil is the same as `PRIMARY', -and t is the same as `SECONDARY'. - -TERMINAL should be a terminal object or a frame specifying the X -server to query. If omitted or nil, that stands for the selected -frame's display, or the first available X display. - -On Nextstep, TERMINAL is unused. */) - (Lisp_Object selection, Lisp_Object terminal) +and t is the same as `SECONDARY'. */) + (Lisp_Object selection) { check_window_system (NULL); CHECK_SYMBOL (selection); @@ -442,22 +430,12 @@ On Nextstep, TERMINAL is unused. */) DEFUN ("ns-get-selection", Fns_get_selection, - Sns_get_selection, 2, 4, 0, + Sns_get_selection, 2, 2, 0, doc: /* Return text selected from some X window. SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. \(Those are literal upper-case symbol names, since that's what X expects.) -TARGET-TYPE is the type of data desired, typically `STRING'. - -TIME-STAMP is the time to use in the XConvertSelection call for foreign -selections. If omitted, defaults to the time for the last event. - -TERMINAL should be a terminal object or a frame specifying the X -server to query. If omitted or nil, that stands for the selected -frame's display, or the first available X display. - -On Nextstep, TIME-STAMP and TERMINAL are unused. */) - (Lisp_Object selection_name, Lisp_Object target_type, - Lisp_Object time_stamp, Lisp_Object terminal) +TARGET-TYPE is the type of data desired, typically `STRING'. */) + (Lisp_Object selection_name, Lisp_Object target_type) { Lisp_Object val = Qnil; @@ -488,16 +466,16 @@ nxatoms_of_nsselect (void) NXSecondaryPboard = @"Secondary"; // This is a memory loss, never released. - pasteboard_changecount = - [[NSMutableDictionary - dictionaryWithObjectsAndKeys: - [NSNumber numberWithLong:0], NSGeneralPboard, - [NSNumber numberWithLong:0], NXPrimaryPboard, - [NSNumber numberWithLong:0], NXSecondaryPboard, - [NSNumber numberWithLong:0], NSStringPboardType, - [NSNumber numberWithLong:0], NSFilenamesPboardType, - [NSNumber numberWithLong:0], NSTabularTextPboardType, - nil] retain]; + pasteboard_changecount + = [[NSMutableDictionary + dictionaryWithObjectsAndKeys: + [NSNumber numberWithLong:0], NSGeneralPboard, + [NSNumber numberWithLong:0], NXPrimaryPboard, + [NSNumber numberWithLong:0], NXSecondaryPboard, + [NSNumber numberWithLong:0], NSStringPboardType, + [NSNumber numberWithLong:0], NSFilenamesPboardType, + [NSNumber numberWithLong:0], NSTabularTextPboardType, + nil] retain]; } void |