comparison lisp/emacs-lisp/lselect.el @ 90224:2d92f5c9d6ae

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-78 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 514-518) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 104-105) - Update from CVS
author Miles Bader <miles@gnu.org>
date Fri, 26 Aug 2005 09:51:52 +0000
parents f9a65d7ebd29 5b1a238fcbb4
children a3716f7538f2
comparison
equal deleted inserted replaced
90223:edf295560b5a 90224:2d92f5c9d6ae
1 ;;; lselect.el --- Lucid interface to X Selections 1 ;;; lselect.el --- Lucid interface to X Selections
2 2
3 ;; Copyright (C) 1990, 1993, 2004 Free Software Foundation, Inc. 3 ;; Copyright (C) 1990, 1993, 2002, 2003, 2004,
4 ;; 2005 Free Software Foundation, Inc.
4 5
5 ;; Maintainer: FSF 6 ;; Maintainer: FSF
6 ;; Keywords: emulations 7 ;; Keywords: emulations
7 8
8 ;; This won't completely work until we support or emulate Lucid-style extents. 9 ;; This won't completely work until we support or emulate Lucid-style extents.
99 (set-extent-priority previous-extent mouse-highlight-priority) 100 (set-extent-priority previous-extent mouse-highlight-priority)
100 (set-extent-face previous-extent face))))) 101 (set-extent-face previous-extent face)))))
101 102
102 103
103 (defun x-own-selection (selection &optional type) 104 (defun x-own-selection (selection &optional type)
104 "Make a primary X Selection of the given argument. 105 "Make a primary X Selection of the given argument.
105 The argument may be a string, a cons of two markers, or an extent. 106 The argument may be a string, a cons of two markers, or an extent.
106 In the latter cases the selection is considered to be the text 107 In the latter cases the selection is considered to be the text
107 between the markers, or the between extents endpoints." 108 between the markers, or the between extents endpoints."
108 (interactive (if (not current-prefix-arg) 109 (interactive (if (not current-prefix-arg)
109 (list (read-string "Store text for pasting: ")) 110 (list (read-string "Store text for pasting: "))
110 (list (cons ;; these need not be ordered. 111 (list (cons ;; these need not be ordered.
111 (copy-marker (point-marker)) 112 (copy-marker (point-marker))
122 selection secondary-selection-extent 'secondary-selection)))) 123 selection secondary-selection-extent 'secondary-selection))))
123 selection) 124 selection)
124 125
125 126
126 (defun x-own-secondary-selection (selection &optional type) 127 (defun x-own-secondary-selection (selection &optional type)
127 "Make a secondary X Selection of the given argument. The argument may be a 128 "Make a secondary X Selection of the given argument. The argument may be a
128 string or a cons of two markers (in which case the selection is considered to 129 string or a cons of two markers (in which case the selection is considered to
129 be the text between those markers.)" 130 be the text between those markers.)"
130 (interactive (if (not current-prefix-arg) 131 (interactive (if (not current-prefix-arg)
131 (list (read-string "Store text for pasting: ")) 132 (list (read-string "Store text for pasting: "))
132 (list (cons ;; these need not be ordered. 133 (list (cons ;; these need not be ordered.
180 181
181 182
182 ;; Random utility functions 183 ;; Random utility functions
183 184
184 (defun x-kill-primary-selection () 185 (defun x-kill-primary-selection ()
185 "If there is a selection, delete the text it covers, and copy it to 186 "If there is a selection, delete the text it covers, and copy it to
186 both the kill ring and the Clipboard." 187 both the kill ring and the Clipboard."
187 (interactive) 188 (interactive)
188 (or (x-selection-owner-p) (error "emacs does not own the primary selection")) 189 (or (x-selection-owner-p) (error "emacs does not own the primary selection"))
189 (setq last-command nil) 190 (setq last-command nil)
190 (or primary-selection-extent 191 (or primary-selection-extent