diff options
| -rw-r--r-- | doc/lispref/frames.texi | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 5e2fdf1231c..99493b59d71 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -4589,7 +4589,7 @@ non-@code{nil}, its return value must be a list of the form | |||
| 4589 | @w{@code{(@var{key} @var{type} @var{value})}}. In this list, | 4589 | @w{@code{(@var{key} @var{type} @var{value})}}. In this list, |
| 4590 | @var{key} must be the name of the data being transferred, generally | 4590 | @var{key} must be the name of the data being transferred, generally |
| 4591 | that of a MIME type, for example @samp{"text/plain"}, and @var{type} | 4591 | that of a MIME type, for example @samp{"text/plain"}, and @var{type} |
| 4592 | is a symbol or a number designating the type of the data, thus also | 4592 | is a symbol or a number designating the type of the data; thus also |
| 4593 | governing the interpretation of @var{value}; following is a list of | 4593 | governing the interpretation of @var{value}; following is a list of |
| 4594 | valid data types and how each of them will cause @var{value} to be | 4594 | valid data types and how each of them will cause @var{value} to be |
| 4595 | interpreted. | 4595 | interpreted. |
| @@ -4809,16 +4809,17 @@ selection name such as @code{UTF8_STRING}. | |||
| 4809 | @cindex XDS | 4809 | @cindex XDS |
| 4810 | @cindex direct save protocol | 4810 | @cindex direct save protocol |
| 4811 | @vindex x-dnd-direct-save-function | 4811 | @vindex x-dnd-direct-save-function |
| 4812 | When Emacs runs on the X window system, it supports the X Direct | 4812 | The X Direct Save (@acronym{XDS}) protocol enables programs to |
| 4813 | Save (@acronym{XDS}) protocol, which allows users to save a file by | 4813 | devolve responsibility for naming a dropped file file upon the |
| 4814 | dragging and dropping it onto an Emacs window, such as a Dired window. | 4814 | recipient. When such a drop transpires, DND handlers and the forgoing |
| 4815 | To comply with the unique requirements of @acronym{XDS}, these | 4815 | X-specific interface are largely circumvented, tasking a different |
| 4816 | drag-and-drop requests are processed specially: instead of being | 4816 | function with responding to the drop. |
| 4817 | handled according to @code{x-dnd-types-alist}, they are handled by the | 4817 | |
| 4818 | @dfn{direct-save function} that is the value of the variable | 4818 | @defvar x-dnd-direct-save-function |
| 4819 | @code{x-dnd-direct-save-function}. The value should be a function of | 4819 | This variable should be set to a function that registers and names |
| 4820 | two arguments, @var{need-name} and @var{filename}. The @acronym{XDS} | 4820 | files dropped using the @acronym{XDS} protocol in a two-step |
| 4821 | protocol uses a two-step procedure for dragging files: | 4821 | procedure. It is provided two arguments, @var{need-name} and |
| 4822 | @var{filename}. | ||
| 4822 | 4823 | ||
| 4823 | @enumerate 1 | 4824 | @enumerate 1 |
| 4824 | @item | 4825 | @item |
| @@ -4846,8 +4847,9 @@ Dired should update the directory on display by showing the new file | |||
| 4846 | there. | 4847 | there. |
| 4847 | @end enumerate | 4848 | @end enumerate |
| 4848 | 4849 | ||
| 4849 | The default value of @code{x-dnd-direct-save-function} is | 4850 | Its default @code{x-dnd-direct-save-function} is |
| 4850 | @code{x-dnd-save-direct}. | 4851 | @code{x-dnd-save-direct}. |
| 4852 | @end defvar | ||
| 4851 | 4853 | ||
| 4852 | @defun x-dnd-save-direct need-name filename | 4854 | @defun x-dnd-save-direct need-name filename |
| 4853 | When called with the @var{need-name} argument non-@code{nil}, this | 4855 | When called with the @var{need-name} argument non-@code{nil}, this |
| @@ -4873,48 +4875,47 @@ default directory.) | |||
| 4873 | @end defun | 4875 | @end defun |
| 4874 | 4876 | ||
| 4875 | @cindex initiating drag-and-drop | 4877 | @cindex initiating drag-and-drop |
| 4876 | On capable window systems, Emacs also supports dragging contents | 4878 | It is also possible to drag content from Emacs to other programs |
| 4877 | from its frames to windows of other applications. | 4879 | whenever this is supported for the current window-system. The |
| 4880 | functions which provide for this are as follows: | ||
| 4878 | 4881 | ||
| 4879 | @cindex drop target, in drag-and-drop operations | 4882 | @cindex drop target, in drag-and-drop operations |
| 4880 | @defun dnd-begin-text-drag text &optional frame action allow-same-frame | 4883 | @defun dnd-begin-text-drag text &optional frame action allow-same-frame |
| 4881 | This function begins dragging text from @var{frame} to another program | 4884 | This function commences a drag-and-drop operation from @var{frame} to |
| 4882 | (known as the @dfn{drop target}), and returns the result of | 4885 | another program (dubbed the @dfn{drop target}), and returns when |
| 4883 | drag-and-drop operation when the text is dropped or the drag-and-drop | 4886 | @var{text} is dropped or the operation is canceled. |
| 4884 | operation is canceled. @var{text} is the text that will be inserted | ||
| 4885 | by the drop target. | ||
| 4886 | 4887 | ||
| 4887 | @var{action} must be one of the symbols @code{copy} or @code{move}, | 4888 | @var{action} must be one of the symbols @code{copy} or @code{move}, |
| 4888 | where @code{copy} means that @var{text} should be inserted by the drop | 4889 | where @code{copy} means that @var{text} should be inserted by the drop |
| 4889 | target, and @code{move} means the same as @code{copy}, but in addition | 4890 | target, and @code{move} means the same as @code{copy}, but furthermore |
| 4890 | the caller may have to delete @var{text} from its source as explained | 4891 | enjoins the caller to delete @var{text} from its source as explained |
| 4891 | below. | 4892 | in the list below. |
| 4892 | 4893 | ||
| 4893 | @var{frame} is the frame where the mouse is currently held down, or | 4894 | @var{frame} is the frame where the mouse is currently held down, or |
| 4894 | @code{nil}, which means to use the selected frame. This function may | 4895 | @code{nil}, which means to use the selected frame. Since this |
| 4895 | return immediately if no mouse buttons are held down, so it should be | 4896 | function is liable to return promptly if no mouse buttons are held |
| 4896 | only called immediately after a @code{down-mouse-1} or similar event | 4897 | down, it should be only called in response to a @code{down-mouse-1} or |
| 4897 | (@pxref{Mouse Events}), with @var{frame} set to the frame where that | 4898 | analogous event (@pxref{Mouse Events}), with @var{frame} set to the |
| 4898 | event was generated (@pxref{Click Events}). | 4899 | frame where that event was generated (@pxref{Click Events}). |
| 4899 | 4900 | ||
| 4900 | @var{allow-same-frame} specifies whether or not drops on top of | 4901 | If @var{allow-same-frame} is @code{nil}, drops on top of @var{frame} |
| 4901 | @var{frame} itself are to be ignored. | 4902 | will be disregarded. |
| 4902 | 4903 | ||
| 4903 | The return value specifies the action that the drop target actually | 4904 | The return value reflects the action that the drop target actually |
| 4904 | performed, and optionally what the caller should do. It can be one of | 4905 | performed, and thus also what action, if any, the caller should in |
| 4905 | the following symbols: | 4906 | turn take. It is one of the following symbols: |
| 4906 | 4907 | ||
| 4907 | @table @code | 4908 | @table @code |
| 4908 | @item copy | 4909 | @item copy |
| 4909 | The drop target inserted the dropped text. | 4910 | The drop target inserted the dropped text. |
| 4910 | 4911 | ||
| 4911 | @item move | 4912 | @item move |
| 4912 | The drop target inserted the dropped text, but in addition the caller | 4913 | The drop target inserted the dropped text, and the caller should |
| 4913 | should delete @var{text} from wherever it originated, such as its | 4914 | delete @var{text} from the buffer where it was extracted from, if |
| 4914 | buffer. | 4915 | applicable. |
| 4915 | 4916 | ||
| 4916 | @item private | 4917 | @item private |
| 4917 | The drop target performed some other unspecified action. | 4918 | The drop target took some other unspecified action. |
| 4918 | 4919 | ||
| 4919 | @item nil | 4920 | @item nil |
| 4920 | The drag-and-drop operation was canceled. | 4921 | The drag-and-drop operation was canceled. |
| @@ -4923,11 +4924,12 @@ The drag-and-drop operation was canceled. | |||
| 4923 | @end defun | 4924 | @end defun |
| 4924 | 4925 | ||
| 4925 | @defun dnd-begin-file-drag file &optional frame action allow-same-frame | 4926 | @defun dnd-begin-file-drag file &optional frame action allow-same-frame |
| 4926 | This function begins dragging @var{file} from @var{frame} to another | 4927 | This function commences a drag-and-drop operation from @var{frame} to |
| 4927 | program, and returns the result of the drag-and-drop operation when | 4928 | another program (dubbed the @dfn{drop target}), and returns when |
| 4928 | the file is dropped or the drag-and-drop operation is canceled. | 4929 | @var{file} is dropped or the operation is canceled. |
| 4929 | 4930 | ||
| 4930 | If @var{file} is a remote file, then a temporary copy will be made. | 4931 | If @var{file} is a remote file, then a temporary local copy will be |
| 4932 | made. | ||
| 4931 | 4933 | ||
| 4932 | @var{action} must be one of the symbols @code{copy}, @code{move} or | 4934 | @var{action} must be one of the symbols @code{copy}, @code{move} or |
| 4933 | @code{link}, where @code{copy} means that @var{file} should be opened | 4935 | @code{link}, where @code{copy} means that @var{file} should be opened |
| @@ -4936,11 +4938,11 @@ move the file to another location, and @code{link} means the drop | |||
| 4936 | target should create a symbolic link to @var{file}. It is an error to | 4938 | target should create a symbolic link to @var{file}. It is an error to |
| 4937 | specify @code{link} as the action if @var{file} is a remote file. | 4939 | specify @code{link} as the action if @var{file} is a remote file. |
| 4938 | 4940 | ||
| 4939 | @var{frame} and @var{allow-same-frame} have the same meaning as in | 4941 | @var{frame} and @var{allow-same-frame} mean the same as they do in |
| 4940 | @code{dnd-begin-text-drag}. | 4942 | calls to @code{dnd-begin-text-drag}. |
| 4941 | 4943 | ||
| 4942 | The return value is the action that the drop target actually | 4944 | The return value is the action that the drop target actually |
| 4943 | performed, which can be one of the following symbols: | 4945 | performed, which is one of the following symbols: |
| 4944 | 4946 | ||
| 4945 | @table @code | 4947 | @table @code |
| 4946 | @item copy | 4948 | @item copy |
| @@ -4969,19 +4971,18 @@ dropping multiple files, then the first file will be used instead. | |||
| 4969 | @end defun | 4971 | @end defun |
| 4970 | 4972 | ||
| 4971 | @defun dnd-direct-save file name &optional frame allow-same-frame | 4973 | @defun dnd-direct-save file name &optional frame allow-same-frame |
| 4972 | This function is similar to @code{dnd-begin-file-drag} (with the | 4974 | The behavior of this function is akin to that of |
| 4973 | default action of copy), but instead of specifying the action you | 4975 | @code{dnd-begin-file-drag} (when the default action @code{copy} is |
| 4974 | specify the name of the copy created by the target program in | 4976 | used), except that it accepts a name under which the copy is meant to |
| 4975 | @code{name}. | 4977 | be filed. |
| 4976 | @end defun | 4978 | @end defun |
| 4977 | 4979 | ||
| 4978 | @cindex initiating drag-and-drop, low-level | 4980 | @cindex initiating drag-and-drop, low-level |
| 4979 | The high-level interfaces described above are implemented on top of | 4981 | The high-level interfaces described above are implemented on top of |
| 4980 | a lower-level primitive. If you need to drag content other than files | 4982 | a lower-level primitive. The low-level interface @code{x-begin-drag} |
| 4981 | or text, use the low-level interface @code{x-begin-drag} | 4983 | is also available for dragging content besides text and files. It |
| 4982 | instead. However, using it will require detailed knowledge of the | 4984 | demands detailed knowledge of the data types and actions understood by |
| 4983 | data types and actions used by the programs to transfer content via | 4985 | programs on each platform its callers wish to support. |
| 4984 | drag-and-drop on each platform you want to support. | ||
| 4985 | 4986 | ||
| 4986 | @defun x-begin-drag targets &optional action frame return-frame allow-current-frame follow-tooltip | 4987 | @defun x-begin-drag targets &optional action frame return-frame allow-current-frame follow-tooltip |
| 4987 | This function begins a drag from @var{frame}, and returns when the | 4988 | This function begins a drag from @var{frame}, and returns when the |
| @@ -4993,60 +4994,59 @@ non-@code{nil}. If no mouse buttons are held down when the | |||
| 4993 | drag-and-drop operation begins, this function may immediately return | 4994 | drag-and-drop operation begins, this function may immediately return |
| 4994 | @code{nil}. | 4995 | @code{nil}. |
| 4995 | 4996 | ||
| 4996 | @var{targets} is a list of strings describing selection targets, much | 4997 | @var{targets} is a list of strings representing selection targets, |
| 4997 | like the @var{data-type} argument to @code{gui-get-selection}, that | 4998 | much like the @var{data-type} argument to @code{gui-get-selection}, |
| 4998 | the drop target can request from Emacs (@pxref{Window System | 4999 | that the drop target can request from Emacs (@pxref{Window System |
| 4999 | Selections}). | 5000 | Selections}). |
| 5000 | 5001 | ||
| 5001 | @var{action} is a symbol describing the action recommended to the | 5002 | @var{action} is a symbol designating the action recommended to the |
| 5002 | target. It can either be @code{XdndActionCopy}, which | 5003 | target. It can either be @code{XdndActionCopy} or |
| 5003 | means to copy the contents of the selection @code{XdndSelection} to | 5004 | @code{XdndActionMove}; both imply copying the contents of the |
| 5004 | the drop target; or @code{XdndActionMove}, which means copy as with | 5005 | selection @code{XdndSelection} to the drop target, but the latter |
| 5005 | @code{XdndActionCopy}, and in addition the caller should delete | 5006 | moreover conveys a promise to delete the contents of the selection |
| 5006 | whatever was stored in that selection after copying it. | 5007 | after the copying. |
| 5007 | 5008 | ||
| 5008 | @var{action} may also be an alist which associates between symbols | 5009 | @var{action} may also be an alist which associates between symbols |
| 5009 | describing the available actions, and strings that the drop target is | 5010 | representing available actions, and strings that the drop target |
| 5010 | expected to present to the user to choose between the available | 5011 | presents to the user for him to select between those actions. |
| 5011 | actions. | ||
| 5012 | 5012 | ||
| 5013 | If @var{return-frame} is non-@code{nil} and the mouse moves over an | 5013 | If @var{return-frame} is non-@code{nil} and the mouse moves over an |
| 5014 | Emacs frame after first moving out of @var{frame}, then the frame to | 5014 | Emacs frame after first moving out of @var{frame}, then the frame to |
| 5015 | which the mouse moves will be returned immediately. If | 5015 | which the mouse moves will be returned immediately. If |
| 5016 | @var{return-frame} is the symbol @code{now}, then any frame underneath | 5016 | @var{return-frame} is the symbol @code{now}, then any frame beneath |
| 5017 | the mouse pointer will be returned without waiting for the mouse to | 5017 | the mouse pointer will be returned without waiting for the mouse to |
| 5018 | first move out of @var{frame}. @var{return-frame} is useful when you | 5018 | first move out of @var{frame}. @var{return-frame} is useful when you |
| 5019 | want to treat dragging content from one frame to another specially, | 5019 | want to treat dragging content from one frame to another specially, |
| 5020 | while also being able to drag content to other programs, but it is not | 5020 | while also dragging content to other programs, but it is not |
| 5021 | guaranteed to work on all systems and with all window managers. | 5021 | guaranteed to function on all systems and with all window managers. |
| 5022 | 5022 | ||
| 5023 | If @var{follow-tooltip} is non-@code{nil}, the position of any tooltip | 5023 | If @var{follow-tooltip} is non-@code{nil}, the position of any tooltip |
| 5024 | (such as one shown by @code{tooltip-show}) will follow the location of | 5024 | (such as one displayed by @code{tooltip-show}) will follow the |
| 5025 | the mouse pointer whenever it moves during the drag-and-drop | 5025 | location of the mouse pointer as it moves during the drag-and-drop |
| 5026 | operation. The tooltip will be hidden once all mouse buttons are | 5026 | operation. The tooltip will be hidden once all mouse buttons are |
| 5027 | released. | 5027 | released. |
| 5028 | 5028 | ||
| 5029 | If the drop was rejected or no drop target was found, this function | 5029 | If the drop was rejected or no drop target was found, this function |
| 5030 | returns @code{nil}. Otherwise, it returns a symbol describing the | 5030 | returns @code{nil}. Otherwise, it returns a symbol representing the |
| 5031 | action the target chose to perform, which can differ from @var{action} | 5031 | action the target opted to take, which can differ from @var{action} if |
| 5032 | if that isn't supported by the drop target. @code{XdndActionPrivate} | 5032 | that isn't supported by the drop target. @code{XdndActionPrivate} is |
| 5033 | is also a valid return value in addition to @code{XdndActionCopy} and | 5033 | also a valid return value in addition to @code{XdndActionCopy} and |
| 5034 | @code{XdndActionMove}; it means that the drop target chose to perform | 5034 | @code{XdndActionMove}; it suggests that the drop target opted for an |
| 5035 | an unspecified action, and no further processing is required by the | 5035 | indeterminate action, and no further action is required of the caller. |
| 5036 | caller. | 5036 | |
| 5037 | 5037 | The caller must cooperate with the target to complete the action | |
| 5038 | The caller must cooperate with the target to fully perform the action | 5038 | selected by the target. For example, callers should delete any buffer |
| 5039 | chosen by the target. For example, callers should delete the buffer | 5039 | text that was dragged if this function returns @code{XdndActionMove}, |
| 5040 | text that was dragged if this function returns @code{XdndActionMove}. | 5040 | and likewise for other drag data where comparable criteria apply. |
| 5041 | @end defun | 5041 | @end defun |
| 5042 | 5042 | ||
| 5043 | @cindex drag and drop protocols, X | 5043 | @cindex drag and drop protocols, X |
| 5044 | 5044 | ||
| 5045 | On X Windows, several different drag-and-drop protocols are | 5045 | The function @code{x-begin-drag} leverages several drag-and-drop |
| 5046 | supported by @code{x-begin-drag}. When dragging content that is known | 5046 | protocols ``behind the scenes''. When dragging content that is known |
| 5047 | to not be supported by a specific drag-and-drop protocol, it might be | 5047 | to not be supported by a specific drag-and-drop protocol, that |
| 5048 | desirable to turn that protocol off, by changing the values of the | 5048 | protocol can be disabled by changing the values of the following |
| 5049 | following variables: | 5049 | variables: |
| 5050 | 5050 | ||
| 5051 | @defvar x-dnd-disable-motif-protocol | 5051 | @defvar x-dnd-disable-motif-protocol |
| 5052 | When this is non-@code{nil}, the Motif drag and drop protocols are | 5052 | When this is non-@code{nil}, the Motif drag and drop protocols are |
| @@ -5070,8 +5070,8 @@ events and the primary selection to insert the text if the drop target | |||
| 5070 | doesn't support any drag-and-drop protocol at all. | 5070 | doesn't support any drag-and-drop protocol at all. |
| 5071 | 5071 | ||
| 5072 | A side effect is that Emacs will become the owner of the primary | 5072 | A side effect is that Emacs will become the owner of the primary |
| 5073 | selection upon such a drop. If that is not desired, then the drop | 5073 | selection upon such a drop. Such emulation can be disabled by setting |
| 5074 | emulation can be disabled by setting this variable to @code{nil}. | 5074 | this variable to @code{nil}. |
| 5075 | @end defvar | 5075 | @end defvar |
| 5076 | 5076 | ||
| 5077 | @node Color Names | 5077 | @node Color Names |