* TIP: Opening selected files with ROX file manager
@ 2022-09-07 18:38 Jean Louis
2022-09-08 1:28 ` Po Lu
0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2022-09-07 18:38 UTC (permalink / raw)
To: Help GNU Emacs
I often have case where I locate files by using Emacs and Dired, and
need to drag and drop those files to other application in X.
For dragging and dropping I like to use ROX file manager.
Problem is when files are many, or there are many images, then opening
of files takes longer time and visually it is not possible to locate
the same files which I wanted to drop or share into chat window of
other application.
Solution is to create temporary directory and make symbolic links
from it.
(defun rcd-temp-directory-name (&optional directory-name)
"Return temporary directory name."
(let ((name (concat (file-name-as-directory (or (getenv "TMPDIR") "/tmp/"))
"temp-dirs/"
(file-name-as-directory (or directory-name (format-time-string "%A-%B-%d-%Y-%H-%M-%S"))))))
name))
(rcd-temp-directory-name) ⇒ "/home/data1/protected/tmp/temp-dirs/Wednesday-September-07-2022-21-35-24/"
The following function opens ROX Filer.
(defun rox (&optional file)
"Start ROX Filer with optional FILE.
FILE can be directory."
(interactive)
(if file
(start-process "Rox" "Rox" "rox" "-n" "-s" file)
(start-process "Rox" "Rox" "rox" "-n")))
And following function is the key function that creates temporary
directory and opens it with graphical file manager containing only
files selected within Dired.
(defun rox-dired-files ()
"Generate temporary directory with selected files in Dired."
(interactive)
(let ((files (dired-get-marked-files)))
(when filesn
(let ((directory (rcd-temp-directory-name)))
(mkdir directory t)
(while files
(let* ((target (pop files))
(linkname (concat (file-name-as-directory directory)
(file-name-nondirectory target))))
(make-symbolic-link target linkname t)))
(rox (expand-file-name directory))))))
It is very hand to assign key in dired to this function, so that
marked files simply appear in new Rox file window.
(keymap-set dired-mode-map "C-c r" #'rox-dired-files)
One can replace Rox with other file managers.
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-07 18:38 TIP: Opening selected files with ROX file manager Jean Louis
@ 2022-09-08 1:28 ` Po Lu
2022-09-08 11:12 ` Jean Louis
0 siblings, 1 reply; 18+ messages in thread
From: Po Lu @ 2022-09-08 1:28 UTC (permalink / raw)
To: Jean Louis; +Cc: Help GNU Emacs
Jean Louis <bugs@gnu.support> writes:
> I often have case where I locate files by using Emacs and Dired, and
> need to drag and drop those files to other application in X.
Emacs 29 has that functionality built in. See dired-mouse-drag-files.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-08 1:28 ` Po Lu
@ 2022-09-08 11:12 ` Jean Louis
2022-09-09 1:45 ` Po Lu
0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2022-09-08 11:12 UTC (permalink / raw)
To: Po Lu; +Cc: Help GNU Emacs
* Po Lu <luangruo@yahoo.com> [2022-09-08 04:30]:
> Jean Louis <bugs@gnu.support> writes:
>
> > I often have case where I locate files by using Emacs and Dired, and
> > need to drag and drop those files to other application in X.
>
> Emacs 29 has that functionality built in. See dired-mouse-drag-files.
Do you mean this below? It does not work, or I do not know how to do
it. I am using touchpad and left mouse button.
dired-mouse-drag is an interactive byte-compiled Lisp function in
‘dired.el’.
(dired-mouse-drag EVENT)
Begin a drag-and-drop operation for the file at EVENT.
If there are marked files and that file is marked, drag every
other marked file as well. Otherwise, unmark all files.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-08 11:12 ` Jean Louis
@ 2022-09-09 1:45 ` Po Lu
2022-09-09 4:17 ` Jean Louis
0 siblings, 1 reply; 18+ messages in thread
From: Po Lu @ 2022-09-09 1:45 UTC (permalink / raw)
To: Help GNU Emacs
Jean Louis <bugs@gnu.support> writes:
> Do you mean this below? It does not work, or I do not know how to do
> it. I am using touchpad and left mouse button.
dired-mouse-drag-files is a user option you have to enable. After you
do, you can simply drag files from Dired with the mouse.
Running the command manually will not work.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-09 1:45 ` Po Lu
@ 2022-09-09 4:17 ` Jean Louis
2022-09-09 7:26 ` Po Lu
0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2022-09-09 4:17 UTC (permalink / raw)
To: Po Lu; +Cc: Help GNU Emacs
* Po Lu <luangruo@yahoo.com> [2022-09-09 04:47]:
> Jean Louis <bugs@gnu.support> writes:
>
> > Do you mean this below? It does not work, or I do not know how to do
> > it. I am using touchpad and left mouse button.
>
> dired-mouse-drag-files is a user option you have to enable. After you
> do, you can simply drag files from Dired with the mouse.
>
> Running the command manually will not work.
I see now.
It is not usable. Attempt to drag it to Rox filer manager results with
"No such file or directory".
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-09 4:17 ` Jean Louis
@ 2022-09-09 7:26 ` Po Lu
2022-09-09 12:15 ` Jean Louis
0 siblings, 1 reply; 18+ messages in thread
From: Po Lu @ 2022-09-09 7:26 UTC (permalink / raw)
To: Help GNU Emacs
Jean Louis <bugs@gnu.support> writes:
> It is not usable. Attempt to drag it to Rox filer manager results with
> "No such file or directory".
What program displays that? ROX File Manager? Or Emacs?
Thanks.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-09 7:26 ` Po Lu
@ 2022-09-09 12:15 ` Jean Louis
2022-09-09 13:40 ` Po Lu
0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2022-09-09 12:15 UTC (permalink / raw)
To: Po Lu; +Cc: Help GNU Emacs
* Po Lu <luangruo@yahoo.com> [2022-09-09 10:28]:
> Jean Louis <bugs@gnu.support> writes:
>
> > It is not usable. Attempt to drag it to Rox filer manager results with
> > "No such file or directory".
>
> What program displays that? ROX File Manager? Or Emacs?
ROX displays the error:
https://gnu.support/files/tmp/2022-09-09/2022-09-09-14:24:48.ogv
Rox is good for drag and drop, but there must be some error.
It works with Caja, but I can't work with slow file managers.
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-09 12:15 ` Jean Louis
@ 2022-09-09 13:40 ` Po Lu
2022-09-11 6:14 ` Jean Louis
0 siblings, 1 reply; 18+ messages in thread
From: Po Lu @ 2022-09-09 13:40 UTC (permalink / raw)
To: Help GNU Emacs
Jean Louis <bugs@gnu.support> writes:
> ROX displays the error:
>
> https://gnu.support/files/tmp/2022-09-09/2022-09-09-14:24:48.ogv
>
> Rox is good for drag and drop, but there must be some error.
>
> It works with Caja, but I can't work with slow file managers.
Can you please trace `xselect-convert-to-text-uri-list' when dragging
the file to ROX, and see what it returns after you do the drop?
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-09 13:40 ` Po Lu
@ 2022-09-11 6:14 ` Jean Louis
2022-09-11 7:48 ` Po Lu
0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2022-09-11 6:14 UTC (permalink / raw)
To: Po Lu; +Cc: Help GNU Emacs
* Po Lu <luangruo@yahoo.com> [2022-09-09 16:47]:
> Jean Louis <bugs@gnu.support> writes:
>
> > ROX displays the error:
> >
> > https://gnu.support/files/tmp/2022-09-09/2022-09-09-14:24:48.ogv
> >
> > Rox is good for drag and drop, but there must be some error.
> >
> > It works with Caja, but I can't work with slow file managers.
>
> Can you please trace `xselect-convert-to-text-uri-list' when dragging
> the file to ROX, and see what it returns after you do the drop?
How do I do that?
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-11 6:14 ` Jean Louis
@ 2022-09-11 7:48 ` Po Lu
2022-09-11 10:34 ` Jean Louis
0 siblings, 1 reply; 18+ messages in thread
From: Po Lu @ 2022-09-11 7:48 UTC (permalink / raw)
To: Help GNU Emacs
Jean Louis <bugs@gnu.support> writes:
> How do I do that?
M-x trace-function RET xselect-convert-to-text-uri-list RET
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-11 7:48 ` Po Lu
@ 2022-09-11 10:34 ` Jean Louis
2022-09-11 12:01 ` Po Lu
0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2022-09-11 10:34 UTC (permalink / raw)
To: Po Lu; +Cc: Help GNU Emacs
* Po Lu <luangruo@yahoo.com> [2022-09-11 10:50]:
> Jean Louis <bugs@gnu.support> writes:
>
> > How do I do that?
>
> M-x trace-function RET xselect-convert-to-text-uri-list RET
Thank you. Here are the results:
======================================================================
1 -> (xselect-convert-to-text-uri-list XdndSelection text/uri-list "file:///home/data1/protected/.xdvirc")
1 <- xselect-convert-to-text-uri-list: (text/uri-list . "file:///home/data1/protected/.xdvirc\n")
======================================================================
1 -> (xselect-convert-to-text-uri-list XdndSelection text/uri-list "file:///home/data1/protected/Screenshot_20220807-225237_1.png")
1 <- xselect-convert-to-text-uri-list: (text/uri-list . "file:///home/data1/protected/Screenshot_20220807-225237_1.png\n")
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-11 10:34 ` Jean Louis
@ 2022-09-11 12:01 ` Po Lu
2022-09-11 13:21 ` Jean Louis
0 siblings, 1 reply; 18+ messages in thread
From: Po Lu @ 2022-09-11 12:01 UTC (permalink / raw)
To: Help GNU Emacs
Jean Louis <bugs@gnu.support> writes:
> ======================================================================
> 1 -> (xselect-convert-to-text-uri-list XdndSelection text/uri-list "file:///home/data1/protected/Screenshot_20220807-225237_1.png")
> 1 <- xselect-convert-to-text-uri-list: (text/uri-list . "file:///home/data1/protected/Screenshot_20220807-225237_1.png\n")
And /home/data1/protected/Screenshot_20220807-225237_1.png is the file
name of the file you dragged, correct? Or more specifically, are there
any non-ASCII characters in the file name that were not encoded
correctly?
If the file name is correct, I think what you're seeing is a bug in ROX
file manager that should be brought up with its developers. Or maybe
you should use Thunar instead.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-11 12:01 ` Po Lu
@ 2022-09-11 13:21 ` Jean Louis
2022-09-12 1:21 ` Po Lu
0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2022-09-11 13:21 UTC (permalink / raw)
To: Po Lu; +Cc: Help GNU Emacs
* Po Lu <luangruo@yahoo.com> [2022-09-11 15:04]:
> Jean Louis <bugs@gnu.support> writes:
>
> > ======================================================================
> > 1 -> (xselect-convert-to-text-uri-list XdndSelection text/uri-list "file:///home/data1/protected/Screenshot_20220807-225237_1.png")
> > 1 <- xselect-convert-to-text-uri-list: (text/uri-list . "file:///home/data1/protected/Screenshot_20220807-225237_1.png\n")
>
> And /home/data1/protected/Screenshot_20220807-225237_1.png is the file
> name of the file you dragged, correct? Or more specifically, are there
> any non-ASCII characters in the file name that were not encoded
> correctly?
>
> If the file name is correct, I think what you're seeing is a bug in ROX
> file manager that should be brought up with its developers. Or maybe
> you should use Thunar instead.
One fact is to be observed, that is that Rox filer never had any
problems with dragging ever.
Is maybe that new line a problem?
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-11 13:21 ` Jean Louis
@ 2022-09-12 1:21 ` Po Lu
2022-09-12 5:45 ` Jean Louis
0 siblings, 1 reply; 18+ messages in thread
From: Po Lu @ 2022-09-12 1:21 UTC (permalink / raw)
To: Help GNU Emacs
Jean Louis <bugs@gnu.support> writes:
> One fact is to be observed, that is that Rox filer never had any
> problems with dragging ever.
Did you ever try dropping _into_ ROX file manager from another program,
such as Thunar or Nautilus?
If that works, please run ROX file manager under xscope and show what
you see. Maybe it's asking for a selection target other than
text/uri-list.
> Is maybe that new line a problem?
No. text/uri-list containing a single URL always ends with a newline.
Thanks.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-12 1:21 ` Po Lu
@ 2022-09-12 5:45 ` Jean Louis
2022-09-12 10:00 ` Po Lu
0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2022-09-12 5:45 UTC (permalink / raw)
To: Po Lu; +Cc: Help GNU Emacs
* Po Lu <luangruo@yahoo.com> [2022-09-12 04:22]:
> Jean Louis <bugs@gnu.support> writes:
>
> > One fact is to be observed, that is that Rox filer never had any
> > problems with dragging ever.
>
> Did you ever try dropping _into_ ROX file manager from another program,
> such as Thunar or Nautilus?
Of course, never problems.
> If that works, please run ROX file manager under xscope and show what
> you see. Maybe it's asking for a selection target other than
> text/uri-list.
What is xscope?
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-12 5:45 ` Jean Louis
@ 2022-09-12 10:00 ` Po Lu
2022-09-12 10:44 ` Jean Louis
0 siblings, 1 reply; 18+ messages in thread
From: Po Lu @ 2022-09-12 10:00 UTC (permalink / raw)
To: Help GNU Emacs
Jean Louis <bugs@gnu.support> writes:
> Of course, never problems.
Odd.
> What is xscope?
xscope is a tool for inspecting X protocol traffic. What I'm asking you
to do is to run:
$ xscope -i6009
$ DISPLAY=localhost:6009 "how you normally run ROX file manager"
and to send the output of xscope after it fails to accept a dropped
file, along with the output of xlsatoms.
Of course, you should inspect the output for sensitive information
first. Thanks.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-12 10:00 ` Po Lu
@ 2022-09-12 10:44 ` Jean Louis
2022-09-12 11:09 ` Po Lu
0 siblings, 1 reply; 18+ messages in thread
From: Jean Louis @ 2022-09-12 10:44 UTC (permalink / raw)
To: Po Lu; +Cc: Help GNU Emacs
* Po Lu <luangruo@yahoo.com> [2022-09-12 13:10]:
> Jean Louis <bugs@gnu.support> writes:
>
> > Of course, never problems.
>
> Odd.
>
> > What is xscope?
>
> xscope is a tool for inspecting X protocol traffic. What I'm asking you
> to do is to run:
OK, but I do not have xscope in Parabola GNU/Linux-libre and I cannot
find it Debian based servers.
Do you have link to software?
Is it maybe part of some other package?
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: TIP: Opening selected files with ROX file manager
2022-09-12 10:44 ` Jean Louis
@ 2022-09-12 11:09 ` Po Lu
0 siblings, 0 replies; 18+ messages in thread
From: Po Lu @ 2022-09-12 11:09 UTC (permalink / raw)
To: Help GNU Emacs
Jean Louis <bugs@gnu.support> writes:
> OK, but I do not have xscope in Parabola GNU/Linux-libre and I cannot
> find it Debian based servers.
>
> Do you have link to software?
>
> Is it maybe part of some other package?
Here's where I get my copy from, though it should be part of xorg-tools
or some similar package:
https://ftp.x.org/archive/individual/app/xscope-1.4.2.tar.gz
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2022-09-12 11:09 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-07 18:38 TIP: Opening selected files with ROX file manager Jean Louis
2022-09-08 1:28 ` Po Lu
2022-09-08 11:12 ` Jean Louis
2022-09-09 1:45 ` Po Lu
2022-09-09 4:17 ` Jean Louis
2022-09-09 7:26 ` Po Lu
2022-09-09 12:15 ` Jean Louis
2022-09-09 13:40 ` Po Lu
2022-09-11 6:14 ` Jean Louis
2022-09-11 7:48 ` Po Lu
2022-09-11 10:34 ` Jean Louis
2022-09-11 12:01 ` Po Lu
2022-09-11 13:21 ` Jean Louis
2022-09-12 1:21 ` Po Lu
2022-09-12 5:45 ` Jean Louis
2022-09-12 10:00 ` Po Lu
2022-09-12 10:44 ` Jean Louis
2022-09-12 11:09 ` Po Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).