With Emacs you can edit remote files with TRAMP. It’s really cool, but sometimes it fails because the remote host shell uses a hyper-fancy prompt. Once I had such troubles, so a replacement was needed.
I use KDE and I’m used to its kio-slaves, which enable the user to work with remote files as if they were on the local system. So I wrote an elisp function which utilize the KDE file dialog, the kio-slaves and emacsclient (only for remote files).
UPDATE: The function below was updated and includes all corrections and enhancements Noone mentioned in his comment.
(defun th-find-file-kio () (interactive) (let ((file-name (replace-regexp-in-string "[\\n]+" "" (shell-command-to-string "kdialog --getopenurl ~ 2> /dev/null")))) (cond ((string-match "^file://" file-name) ;; Work arround a bug in kioexec, which causes it to delete local ;; files. (See bugs.kde.org, Bug 127894.) Because of this we open the ;; file with `find-file' instead of emacsclient. (let ((local-file-name (substring file-name 7))) (message "Opening local file '%s'" local-file-name) (find-file local-file-name))) ((string-match "^[:space:]*$" file-name) (message "Empty file name given, doing nothing...")) (t (message "Opening remote file '%s'" file-name) (save-window-excursion (shell-command (concat "kioexec emacsclient " file-name "&"))))))) (defalias 'ffk 'th-find-file-kio)
With M-x ffk or M-x th-find-file-kio the KDE file dialog will be opened and you can choose a file, may it be local or on a remote host. Then the file will be opened. If it’s local, it will be opened in Emacs with the find-file function and you can edit it as if you opened it in Emacs directly.
If it’s a remote file the temporary file created by the kio-slave will be opened with emacsclient. Edit the file and when you’re finished type C-c g (server-edit). A dialog box will pop up and ask if the changes should be uploaded to the remote host.