--- killing.texi.orig Sun May 3 01:24:11 1998 +++ killing.texi Sat Nov 18 12:04:28 2000 @@ -15,9 +15,9 @@ special purposes. Emacs has only one kill ring, so you can kill text in one buffer and yank -it in another buffer. If you are using XEmacs under X, you can -also use the X selection mechanism to copy text from one buffer to -another, or between applications. @xref{Using X Selections}. +it in another buffer. If you are using XEmacs under a window system, you can +also use the window system's native selection mechanism to copy text from one +buffer to another, or between applications. @xref{Using Selections}. @end iftex @@ -186,7 +186,7 @@ sentences, with @kbd{C-x @key{DEL}} and @kbd{M-k} (@pxref{Sentences}).@refill -@node Yanking, Using X Selections, Killing, Top +@node Yanking, Using Selections, Killing, Top @section Yanking @cindex moving text @cindex copying text @@ -351,10 +351,42 @@ The variable @code{kill-ring-max} controls the length of the kill ring; no more than that many blocks of killed text are saved. -@node Using X Selections, Accumulating Text, Yanking, Top -@section Using X Selections +@node Using Selections, Accumulating Text, Yanking, Top +@section Using Selections @comment node-name, next, previous, up +Window systems usually provide their own native support for selections; +the exact semantics and naming conventions vary - the X window system +for example provides multiple selections that any application can access +via standard function calls; most other window systems, on the other hand, +provide a clipboard-like model, where the selection has to be explicitly +copied to the clipboard before it can be ``pasted'' into another application. + +XEmacs supports both of these conventions through an X-like selection +mechanism with a special @b{Clipboard} selection to support window systems +that use the clipboard model. + + +@menu +* Selections Under X:: Selections under the X window system +* Selections Under MS Windows:: Selections on Microsoft Windows +* Clipboard Selection:: Pasting to the X clipboard. +* Selection Commands:: Other operations on the selection. +* Active Regions:: Using zmacs-style highlighting of the + selected region. +* X Cut Buffers:: X cut buffers are available for compatibility. +@end menu + +@node Selections Under X, Selections Under MS Windows, Using Selections, Using Selections +@comment node-name, next, previous, up +@subsection Selections Under X + +This section describes the X-specific behaviour of the XEmacs selection +mechanism. If you are using another window system that natively supports the +concept of selections (i.e. you can select text in one program and immediately +paste it into another without having to ``cut'' or ``copy'' it first), then +this section probably applies to you also. + In the X window system, mouse selections provide a simple mechanism for text transfer between different applications. In a typical X application, you can select text by pressing the left mouse button and @@ -362,6 +394,15 @@ primary X selection and is highlighted. The highlighted region is also the Emacs selected region. +XEmacs provides a slight extension to the X selection semantics; XEmacs +selections can hold more than one format of data at a time (and the +representation of that data in each format could be entirely different - +for example, a bitmap selected using this paradigm could have both text and +bitmap formats in the primary selection). Note that this extension is only +visible outside XEmacs in a very limited way under X due to the fact that +there is no good way of telling a program that requests the selection what +type of data it is that is selected. + @itemize @bullet @item Since the region is the primary X selection, you can go to a different X @@ -373,31 +414,13 @@ menu to manipulate the selected text. @end itemize -@menu -* X Clipboard Selection:: Pasting to the X clipboard. -* X Selection Commands:: Other operations on the selection. -* X Cut Buffers:: X cut buffers are available for compatibility. -* Active Regions:: Using zmacs-style highlighting of the - selected region. -@end menu - -@node X Clipboard Selection, X Selection Commands, Using X Selections, Using X Selections -@comment node-name, next, previous, up -@subsection The Clipboard Selection -@cindex clipboard selections - -There are other kinds of X selections besides the @b{Primary} selection; one -common one is the @b{Clipboard} selection. Some applications prefer to -transfer data using this selection in preference to the @b{Primary}. -One can transfer text from the @b{Primary} selection to the @b{Clipboard} -selection with the @b{Copy} command under the @b{Edit} menu in the menubar. - -Usually, the clipboard selection is not visible. However, if you run the -@file{xclipboard} application, the text most recently copied to the clipboard -(with the @b{Copy} command) is displayed in a window. Any time new text is -thus copied, the @file{xclipboard} application makes a copy of it and displays -it in its window. The value of the clipboard can survive the lifetime of the -running Emacs process. The @code{xclipboard} man page provides more details. +Under X, selection data is maintained by the program that owns it, thus the +selections (including the @b{Clipboard} selection) expire when that program +exits. There are programs like the @file{xclipboard} application, or some +of the utilities programs that execute under OSF/Motif that will remember the +@b{Clipboard} selection even after the original owner exits; they do this by +explicitly taking control of the selection whenever it changes. See the +@code{xclipboard} man page for more information. Warning: If you use the @file{xclipboard} application, remember that it maintains a list of all things that have been pasted to the clipboard (that @@ -405,8 +428,58 @@ from this list by clicking on the @b{Delete} button in the @code{xclipboard} window, the clipboard will eventually consume a lot of memory. -In summary, some X applications (such as @file{xterm}) allow one to paste -text in them from XEmacs in the following way: +@node Selections Under MS Windows, Clipboard Selection, Using Selections, Using Selections +@comment node-name, next, previous, up +@subsection Selections On Microsoft Windows + +This section describes XEmacs-selection behaviour specific to the Microsoft +Windows operating system. If you are using another window system that does not +have native support for X-style selections (i.e. in order to paste text you must +first ``cut'' or ``copy'' it), this section probably applies to you also. + +Under Microsoft Windows, applications typically provide the standard ``cut'', +``copy'' and ``paste'' commands that transfer data from the application (which +will typically hold it in some application-specific format) onto the clipboard, +in a standard format. Unlike the X window system, the Microsoft Windows +clipboard is capable of holding the same data rendered into a number of different +data formats simultaneously; a ``paste'' command usually causes the application +to select the most appropriate format currently available on the clipboard, and +some applications provide an additional ``paste special'' command that allows +the user to select their preferred format. + +XEmacs support for the clipboard is based upon the X selection model, through +the special selection @b{Clipboard} (incidentally, this is the same mechanism +that many X programs use to achieve the familiar clipboard model). Unlike +ordinary X selections, however, XEmacs is capable of maintaining more than one +type of data in any given selection at a time. + +Unlike the X window system, Windows maintains the clipboard itself; this means +that text or other data copied to it will remain after XEmacs exits. + +@node Clipboard Selection, Selection Commands, Using Selections, Using Selections +@comment node-name, next, previous, up +@subsection The Clipboard Selection +@cindex clipboard selections + +There are other kinds of XEmacs selections besides the @b{Primary} selection; +one common one is the @b{Clipboard} selection. Some applications (or +some window systems!) prefer to transfer data using this selection in preference +to the @b{Primary}. One can transfer text from the @b{Primary} selection to +the @b{Clipboard} selection with the @b{Copy} command under the @b{Edit} menu +in the menubar. + +Usually, the clipboard selection is not visible. However, if you run the +@file{xclipboard} application under X, the ``Clipboard Viewer'' application +under Windows or your window system's equivalent, the text most recently +copied to the clipboard (with the @b{Copy} command) is displayed in a window. +Any time new text is thus copied, the @file{xclipboard} application makes a +copy of it and displays it in its window. The value of the clipboard can +survive the lifetime of the running Emacs process. The @code{xclipboard} man +page provides more details. + +In summary, on window systems providing native support for the selection model, +some applications (such as @file{xterm} under X) allow one to paste text into +them from XEmacs in the following way: @itemize @bullet @item @@ -418,8 +491,8 @@ selection. @end itemize -With some other applications (notably, the OpenWindows and Motif tools) you -must use this method instead: +Other applications, or applications running on window systems not supporting +the selection model, tend to require you to use this method instead: @itemize @bullet @item @@ -436,73 +509,35 @@ menu, or by hitting the @b{Paste} key on your keyboard. @end itemize - -@node X Selection Commands, X Cut Buffers, X Clipboard Selection, Using X Selections -@subsection Miscellaneous X Selection Commands +@node Selection Commands, Active Regions, Clipboard Selection, Using Selections +@subsection Miscellaneous Selection Commands @comment node-name, next, previous, up @cindex cut buffers @cindex primary selections -@findex x-copy-primary-selection -@findex x-delete-primary-selection -@findex x-insert-selection -@findex x-kill-primary-selection -@findex x-mouse-kill -@findex x-own-secondary-selection -@findex x-own-selection -@findex x-set-point-and-insert-selection +@findex copy-primary-selection +@findex delete-primary-selection +@findex insert-selection +@findex kill-primary-selection +@findex own-selection @table @kbd -@item M-x x-copy-primary-selection +@item M-x copy-primary-selection Copy the primary selection to both the kill ring and the Clipboard. -@item M-x x-insert-selection +@item M-x insert-selection Insert the current selection into the buffer at point. -@item M-x x-delete-primary-selection +@item M-x delete-primary-selection Deletes the text in the primary selection without copying it to the kill ring or the Clipboard. -@item M-x x-kill-primary-selection +@item M-x kill-primary-selection Deletes the text in the primary selection and copies it to both the kill ring and the Clipboard. -@item M-x x-mouse-kill -Kill the text between point and the mouse and copy it to -the clipboard and to the cut buffer. -@item M-x x-own-secondary-selection -Make a secondary X selection of the given argument. -@item M-x x-own-selection -Make a primary X selection of the given argument. -@item M-x x-set-point-and-insert-selection -Set point where clicked and insert the primary selection or the -cut buffer. +@item M-x own-selection +Take ownership of the specified selection of the specified data type; +alternatively, this function can append more data to the specified +selection, or add data of another type to the selection. @end table -@node X Cut Buffers, Active Regions, X Selection Commands, Using X Selections -@subsection X Cut Buffers -@comment node-name, next, previous, up - -X cut buffers are a different, older way of transferring text between -applications. XEmacs supports cut buffers for compatibility -with older programs, even though selections are now the preferred way of -transferring text. - -X has a concept of applications "owning" selections. When you select -text by clicking and dragging inside an application, the application -tells the X server that it owns the selection. When another -application asks the X server for the value of the selection, the X -server requests the information from the owner. When you use -selections, the selection data is not actually transferred unless -someone wants it; the act of making a selection doesn't transfer data. -Cut buffers are different: when you "own" a cut buffer, the data is -actually transferred to the X server immediately, and survives the -lifetime of the application. - -Any time a region of text becomes the primary selection in Emacs, -Emacs also copies that text to the cut buffer. This makes it possible -to copy text from an XEmacs buffer and paste it into an older, -non-selection-based application (such as Emacs 18). - -Note: Older versions of Emacs could not access the X selections, only -the X cut buffers. - -@node Active Regions, , X Cut Buffers, Using X Selections +@node Active Regions, X Cut Buffers, Selection Commands, Using Selections @subsection Active Regions @comment node-name, next, previous, up @cindex active regions @@ -607,6 +642,34 @@ between point and the mark by using @code{zmacs-deactivate-region}. Note: you should not have to call this function; the command loop calls it when appropriate. + +@node X Cut Buffers, , Active Regions, Using Selections +@subsection X Cut Buffers +@comment node-name, next, previous, up + +X cut buffers are a different, older way of transferring text between +applications. XEmacs supports cut buffers for compatibility +with older programs, even though selections are now the preferred way of +transferring text. + +X has a concept of applications "owning" selections. When you select +text by clicking and dragging inside an application, the application +tells the X server that it owns the selection. When another +application asks the X server for the value of the selection, the X +server requests the information from the owner. When you use +selections, the selection data is not actually transferred unless +someone wants it; the act of making a selection doesn't transfer data. +Cut buffers are different: when you "own" a cut buffer, the data is +actually transferred to the X server immediately, and survives the +lifetime of the application. + +Any time a region of text becomes the primary selection in Emacs, +Emacs also copies that text to the cut buffer. This makes it possible +to copy text from an XEmacs buffer and paste it into an older, +non-selection-based application (such as Emacs 18). + +Note: Older versions of Emacs could not access the X selections, only +the X cut buffers. @node Accumulating Text, Rectangles, Using X Selections, Top @section Accumulating Text --- menus.texi.orig Thu Jul 13 16:34:52 2000 +++ menus.texi Sat Nov 18 11:59:04 2000 @@ -70,7 +70,7 @@ @b{Edit} menu appear faded until you select text on which they are to operate; after you select a block of text, edit commands are enabled. @xref{Mouse Selection}, for information on using the mouse to select -text. @xref{Using X Selections}, for related information. +text. @xref{Using Selections}, for related information. There are also @kbd{M-x} equivalents for each menu item. To find the equivalent for any left-button menu item, do the following: @@ -212,7 +212,7 @@ The @b{Edit} pull-down menu contains the @b{Undo}, @b{Cut}, @b{Copy}, @b{Paste}, and @b{Clear} menu items. When you select a menu item, Emacs executes the equivalent command. Most commands on the @b{Edit} menu -work on a block of text, the X selection. They appear faded until you +work on a block of text, the selection. They appear faded until you select a block of text (activate a region) with the mouse. @xref{Using X Selections}, @pxref{Killing}, and @pxref{Yanking} for more information.@refill --- mouse.texi.orig Wed Dec 18 22:43:51 1996 +++ mouse.texi Sat Nov 18 11:58:39 2000 @@ -49,9 +49,9 @@ @end enumerate The selected region of text is highlighted. - Once a region of text is selected, it becomes the primary X selection -(@pxref{Using X Selections}) as well as the Emacs selected region. You -can paste it into other X applications and use the options from the + Once a region of text is selected, it becomes the primary selection +(@pxref{Using Selections}) as well as the Emacs selected region. You +can paste it into other applications and use the options from the @b{Edit} pull-down menu on it. Since it is also the Emacs region, you can use Emacs region commands on it. --- xemacs.texi.orig Thu Jul 13 16:34:53 2000 +++ xemacs.texi Sat Nov 18 11:19:40 2000 @@ -146,7 +146,7 @@ Other operations available from the mouse. * Killing:: Killing text. * Yanking:: Recovering killed text. Moving text. -* Using X Selections:: +* Using Selections:: Using primary selection, cut buffers, and highlighted regions. * Accumulating Text:: Other ways of copying text. @@ -261,13 +261,15 @@ * Appending Kills:: Several kills in a row all yank together. * Earlier Kills:: Yanking something killed some time ago. -Using X Selections +Using Selections -* X Clipboard Selection:: Pasting to the X clipboard. -* X Selection Commands:: Other operations on the selection. -* X Cut Buffers:: X cut buffers are available for compatibility. +* Selections Under X:: Selections under the X window system +* Selections Under MS Windows:: Selections on Microsoft Windows +* Clipboard Selection:: Pasting to the X clipboard. +* Selection Commands:: Other operations on the selection. * Active Regions:: Using zmacs-style highlighting of the - selected region. + selected region. +* X Cut Buffers:: X cut buffers are available for compatibility. Registers