emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 41a2def162: Convert FILE_NAME to refs on Haiku instead of text/ur


From: Po Lu
Subject: master 41a2def162: Convert FILE_NAME to refs on Haiku instead of text/uri-list
Date: Tue, 31 May 2022 09:33:25 -0400 (EDT)

branch: master
commit 41a2def162ee95db6a9ca7e904bbd7feee5e3ccf
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Convert FILE_NAME to refs on Haiku instead of text/uri-list
    
    * 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 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/term/haiku-win.el b/lisp/term/haiku-win.el
index 7f3bba52e5..a8cc1da731 100644
--- a/lisp/term/haiku-win.el
+++ b/lisp/term/haiku-win.el
@@ -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))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]