Mercurial > emacs
comparison lisp/term/x-win.el @ 72412:ec8109b4dd1d
(x-clipboard-yank): Specify * in interactive spec.
(special-event-map): Process drag-n-drop events this way.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 16 Aug 2006 05:09:18 +0000 |
parents | 956d4fe07987 |
children | 0f049b50713b 694bbb62a75d 7f3f771c85fa |
comparison
equal
deleted
inserted
replaced
72411:b11613448626 | 72412:ec8109b4dd1d |
---|---|
2503 (menu-bar-enable-clipboard) | 2503 (menu-bar-enable-clipboard) |
2504 | 2504 |
2505 ;; Override Paste so it looks at CLIPBOARD first. | 2505 ;; Override Paste so it looks at CLIPBOARD first. |
2506 (defun x-clipboard-yank () | 2506 (defun x-clipboard-yank () |
2507 "Insert the clipboard contents, or the last stretch of killed text." | 2507 "Insert the clipboard contents, or the last stretch of killed text." |
2508 (interactive) | 2508 (interactive "*") |
2509 (let ((clipboard-text (x-selection-value 'CLIPBOARD)) | 2509 (let ((clipboard-text (x-selection-value 'CLIPBOARD)) |
2510 (x-select-enable-clipboard t)) | 2510 (x-select-enable-clipboard t)) |
2511 (if (and clipboard-text (> (length clipboard-text) 0)) | 2511 (if (and clipboard-text (> (length clipboard-text) 0)) |
2512 (kill-new clipboard-text)) | 2512 (kill-new clipboard-text)) |
2513 (yank))) | 2513 (yank))) |
2517 :enable (not buffer-read-only) | 2517 :enable (not buffer-read-only) |
2518 :help "Paste (yank) text most recently cut/copied")) | 2518 :help "Paste (yank) text most recently cut/copied")) |
2519 | 2519 |
2520 ;; Initiate drag and drop | 2520 ;; Initiate drag and drop |
2521 (add-hook 'after-make-frame-functions 'x-dnd-init-frame) | 2521 (add-hook 'after-make-frame-functions 'x-dnd-init-frame) |
2522 (global-set-key [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) | 2522 (define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) |
2523 | 2523 |
2524 ;; Let F10 do menu bar navigation. | 2524 ;; Let F10 do menu bar navigation. |
2525 (and (fboundp 'menu-bar-open) | 2525 (and (fboundp 'menu-bar-open) |
2526 (global-set-key [f10] 'menu-bar-open)) | 2526 (global-set-key [f10] 'menu-bar-open)) |
2527 | 2527 |