Function: ghostel--dnd-handle-file

ghostel--dnd-handle-file is a natively compiled function defined in ghostel.el.

Signature

(ghostel--dnd-handle-file URI ACTION)

Documentation

Paste the local file named by URI into the terminal, shell-quoted.

Handles dnd-protocol-alist file drops on the ports that dispatch drops through special-event-map (X11, pgtk). A non-local URI is ignored with a message; a drop into a dead terminal opens the file with ACTION instead.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel.el
(defun ghostel--dnd-handle-file (uri action)
  "Paste the local file named by URI into the terminal, shell-quoted.
Handles `dnd-protocol-alist' file drops on the ports that dispatch
drops through `special-event-map' (X11, pgtk).  A non-local URI is
ignored with a message; a drop into a dead terminal opens the file
with ACTION instead."
  (let* ((local (if (string-match-p "\\`file://[^/]" uri)
                    (dnd-get-local-file-uri uri)
                  uri))
         (file (and local (dnd-get-local-file-name local))))
    (cond ((null file)
           (message "ghostel: ignoring dropped %s (not a local file)" uri))
          ((process-live-p ghostel--process)
           (ghostel--dnd-send-files (list file)))
          (t (dnd-open-local-file local action))))
  'private)