aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2015-05-23 11:32:29 -0400
committerStefan Monnier2015-05-23 11:32:29 -0400
commit919281ddb2eec5b5503c246dfad902d44aa25644 (patch)
tree1204a207b7d24c596caed1beeda629c27ba2f90d /src
parentdc4484ec6de13a3d75b52c477a3cde59dc8ed46c (diff)
downloademacs-919281ddb2eec5b5503c246dfad902d44aa25644.tar.gz
emacs-919281ddb2eec5b5503c246dfad902d44aa25644.zip
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')
-rw-r--r--src/nsselect.m60
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. */)
385 385
386 386
387DEFUN ("ns-selection-exists-p", Fns_selection_exists_p, Sns_selection_exists_p, 387DEFUN ("ns-selection-exists-p", Fns_selection_exists_p, Sns_selection_exists_p,
388 0, 2, 0, doc: /* Whether there is an owner for the given X selection. 388 0, 1, 0, doc: /* Whether there is an owner for the given X selection.
389SELECTION should be the name of the selection in question, typically 389SELECTION should be the name of the selection in question, typically
390one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. (X expects 390one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. (X expects
391these literal upper-case names.) The symbol nil is the same as 391these literal upper-case names.) The symbol nil is the same as
392`PRIMARY', and t is the same as `SECONDARY'. 392`PRIMARY', and t is the same as `SECONDARY'. */)
393 393 (Lisp_Object selection)
394TERMINAL should be a terminal object or a frame specifying the X
395server to query. If omitted or nil, that stands for the selected
396frame's display, or the first available X display.
397
398On Nextstep, TERMINAL is unused. */)
399 (Lisp_Object selection, Lisp_Object terminal)
400{ 394{
401 id pb; 395 id pb;
402 NSArray *types; 396 NSArray *types;
@@ -416,20 +410,14 @@ On Nextstep, TERMINAL is unused. */)
416 410
417 411
418DEFUN ("ns-selection-owner-p", Fns_selection_owner_p, Sns_selection_owner_p, 412DEFUN ("ns-selection-owner-p", Fns_selection_owner_p, Sns_selection_owner_p,
419 0, 2, 0, 413 0, 1, 0,
420 doc: /* Whether the current Emacs process owns the given X Selection. 414 doc: /* Whether the current Emacs process owns the given X Selection.
421The arg should be the name of the selection in question, typically one of 415The arg should be the name of the selection in question, typically one of
422the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. 416the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
423\(Those are literal upper-case symbol names, since that's what X expects.) 417\(Those are literal upper-case symbol names, since that's what X expects.)
424For convenience, the symbol nil is the same as `PRIMARY', 418For convenience, the symbol nil is the same as `PRIMARY',
425and t is the same as `SECONDARY'. 419and t is the same as `SECONDARY'. */)
426 420 (Lisp_Object selection)
427TERMINAL should be a terminal object or a frame specifying the X
428server to query. If omitted or nil, that stands for the selected
429frame's display, or the first available X display.
430
431On Nextstep, TERMINAL is unused. */)
432 (Lisp_Object selection, Lisp_Object terminal)
433{ 421{
434 check_window_system (NULL); 422 check_window_system (NULL);
435 CHECK_SYMBOL (selection); 423 CHECK_SYMBOL (selection);
@@ -442,22 +430,12 @@ On Nextstep, TERMINAL is unused. */)
442 430
443 431
444DEFUN ("ns-get-selection", Fns_get_selection, 432DEFUN ("ns-get-selection", Fns_get_selection,
445 Sns_get_selection, 2, 4, 0, 433 Sns_get_selection, 2, 2, 0,
446 doc: /* Return text selected from some X window. 434 doc: /* Return text selected from some X window.
447SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. 435SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
448\(Those are literal upper-case symbol names, since that's what X expects.) 436\(Those are literal upper-case symbol names, since that's what X expects.)
449TARGET-TYPE is the type of data desired, typically `STRING'. 437TARGET-TYPE is the type of data desired, typically `STRING'. */)
450 438 (Lisp_Object selection_name, Lisp_Object target_type)
451TIME-STAMP is the time to use in the XConvertSelection call for foreign
452selections. If omitted, defaults to the time for the last event.
453
454TERMINAL should be a terminal object or a frame specifying the X
455server to query. If omitted or nil, that stands for the selected
456frame's display, or the first available X display.
457
458On Nextstep, TIME-STAMP and TERMINAL are unused. */)
459 (Lisp_Object selection_name, Lisp_Object target_type,
460 Lisp_Object time_stamp, Lisp_Object terminal)
461{ 439{
462 Lisp_Object val = Qnil; 440 Lisp_Object val = Qnil;
463 441
@@ -488,16 +466,16 @@ nxatoms_of_nsselect (void)
488 NXSecondaryPboard = @"Secondary"; 466 NXSecondaryPboard = @"Secondary";
489 467
490 // This is a memory loss, never released. 468 // This is a memory loss, never released.
491 pasteboard_changecount = 469 pasteboard_changecount
492 [[NSMutableDictionary 470 = [[NSMutableDictionary
493 dictionaryWithObjectsAndKeys: 471 dictionaryWithObjectsAndKeys:
494 [NSNumber numberWithLong:0], NSGeneralPboard, 472 [NSNumber numberWithLong:0], NSGeneralPboard,
495 [NSNumber numberWithLong:0], NXPrimaryPboard, 473 [NSNumber numberWithLong:0], NXPrimaryPboard,
496 [NSNumber numberWithLong:0], NXSecondaryPboard, 474 [NSNumber numberWithLong:0], NXSecondaryPboard,
497 [NSNumber numberWithLong:0], NSStringPboardType, 475 [NSNumber numberWithLong:0], NSStringPboardType,
498 [NSNumber numberWithLong:0], NSFilenamesPboardType, 476 [NSNumber numberWithLong:0], NSFilenamesPboardType,
499 [NSNumber numberWithLong:0], NSTabularTextPboardType, 477 [NSNumber numberWithLong:0], NSTabularTextPboardType,
500 nil] retain]; 478 nil] retain];
501} 479}
502 480
503void 481void