]> git.eshelyaron.com Git - emacs.git/commitdiff
Convert FILE_NAME to refs on Haiku instead of text/uri-list
authorPo Lu <luangruo@yahoo.com>
Tue, 31 May 2022 13:31:18 +0000 (13:31 +0000)
committerPo Lu <luangruo@yahoo.com>
Tue, 31 May 2022 13:32:41 +0000 (13:32 +0000)
* lisp/term/haiku-win.el (haiku-dnd-selection-converters): Use
more appropriate target for file names.
(haiku-dnd-convert-uri-list): Delete function.
(haiku-dnd-convert-file-name): New function.  Also handle remote
file names.

lisp/term/haiku-win.el

index 7f3bba52e5961ab2138b656c1ad6c5349365c5a4..a8cc1da731aa3e0fab541b768701a7be2e48f07b 100644 (file)
@@ -52,7 +52,7 @@
   "The local value of the special `XdndSelection' selection.")
 
 (defvar haiku-dnd-selection-converters '((STRING . haiku-dnd-convert-string)
-                                         (text/uri-list . haiku-dnd-convert-uri-list))
+                                         (FILE_NAME . haiku-dnd-convert-file-name))
   "Alist of X selection types to functions that act as selection converters.
 The functions should accept a single argument VALUE, describing
 the value of the drag-and-drop selection, and return a list of
@@ -141,9 +141,10 @@ VALUE as a unibyte string, or nil if VALUE was not a string."
     (list "text/plain" (string-to-unibyte
                         (encode-coding-string value 'utf-8)))))
 
-(defun haiku-dnd-convert-uri-list (value)
+(defun haiku-dnd-convert-file-name (value)
   "Convert VALUE to a file system reference if it is a file name."
   (when (and (stringp value)
+             (not (file-remote-p value))
              (file-exists-p value))
     (list "refs" (propertize (expand-file-name value) 'type 'ref))))