diff options
Diffstat (limited to 'lisp/select.el')
-rw-r--r-- | lisp/select.el | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lisp/select.el b/lisp/select.el index 2d501f207f1..019be9cb23b 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -829,7 +829,8 @@ This function returns the string \"emacs\"." (concat value [0])))) (defun xselect-uri-list-available-p (selection _type value) - "Return whether or not `text/uri-list' is a valid target for SELECTION. + "Return non-nil if `text/uri-list' is a valid target for SELECTION. +Return nil otherwise. VALUE is the local selection value of SELECTION." (and (eq selection 'XdndSelection) (or (stringp value) @@ -839,13 +840,20 @@ VALUE is the local selection value of SELECTION." "") (defun xselect-dt-netfile-available-p (selection _type value) - "Return whether or not `_DT_NETFILE' is a valid target for SELECTION. + "Return non-nil if `_DT_NETFILE' is a valid target for SELECTION. +Return nil otherwise. VALUE is SELECTION's local selection value." (and (eq selection 'XdndSelection) (stringp value) (file-exists-p value) (not (file-remote-p value)))) +(defun xselect-dnd-target-available-p (selection _type _value) + "Return non-nil if TYPE is a valid target for SELECTION. +Return nil otherwise. +VALUE is SELECTION's local selection value." + (eq selection 'XdndSelection)) + (defun xselect-tt-net-file (file) "Get the canonical ToolTalk filename for FILE. FILE must be a local file, or otherwise the conversion will fail. @@ -890,7 +898,8 @@ VALUE should be SELECTION's local value." (text/plain\;charset=utf-8 . xselect-convert-to-string) (text/uri-list . (xselect-uri-list-available-p . xselect-convert-to-text-uri-list)) - (text/x-xdnd-username . xselect-convert-to-username) + (text/x-xdnd-username . (xselect-dnd-target-available-p + . xselect-convert-to-username)) (FILE . (xselect-uri-list-available-p . xselect-convert-to-xm-file)) (TARGETS . xselect-convert-to-targets) @@ -909,8 +918,10 @@ VALUE should be SELECTION's local value." (INTEGER . xselect-convert-to-integer) (SAVE_TARGETS . xselect-convert-to-save-targets) (_EMACS_INTERNAL . xselect-convert-to-identity) - (XmTRANSFER_SUCCESS . xselect-convert-xm-special) - (XmTRANSFER_FAILURE . xselect-convert-xm-special) + (XmTRANSFER_SUCCESS . (xselect-dnd-target-available-p + . xselect-convert-xm-special)) + (XmTRANSFER_FAILURE . (xselect-dnd-target-available-p + . xselect-convert-xm-special)) (_DT_NETFILE . (xselect-dt-netfile-available-p . xselect-convert-to-dt-netfile)))) |