unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* An emacs based `xdg-desktop-portal` filechooser
@ 2023-05-31 20:16 Rahguzar
  2023-06-01 18:42 ` Peter Oliver
  2023-06-12 11:04 ` James Thomas
  0 siblings, 2 replies; 5+ messages in thread
From: Rahguzar @ 2023-05-31 20:16 UTC (permalink / raw)
  To: emacs-devel

Hi All,
   During the past few weeks, I have been working on an Emacs based implementation of filechooser backend of `xdg-desktop-portal`. It is very rough around the edges but I have working version at https://codeberg.org/rahguzar/filechooser.

   When I started I want to put the end result on Gnu Elpa (and that is why I am posting here, apologies if this isn't the right thing) but it has serious enough limitations that I don't know if it is a good idea. The limitations are detailed in the readme file. If you are feeling adventurous and want to try it out please let me know of your experience and suggestions/criticism.

P.S. I would like to thank Michael Albinus for the dbus support in Emacs and especially `dbus-monitor` which was very useful in coming to grips with the maze that is dbus.

Rahguzar



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: An emacs based `xdg-desktop-portal` filechooser
  2023-05-31 20:16 An emacs based `xdg-desktop-portal` filechooser Rahguzar
@ 2023-06-01 18:42 ` Peter Oliver
  2023-06-02 20:00   ` Rahguzar
  2023-06-12 11:04 ` James Thomas
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Oliver @ 2023-06-01 18:42 UTC (permalink / raw)
  To: Rahguzar; +Cc: emacs-devel

On Wed, 31 May 2023, Rahguzar wrote:

> The limitations are detailed in the readme file.

To ensure that Emacs is started before emacsclient, perhaps systemd socket activation is worth investigating.

-- 
Peter Oliver



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: An emacs based `xdg-desktop-portal` filechooser
  2023-06-01 18:42 ` Peter Oliver
@ 2023-06-02 20:00   ` Rahguzar
  0 siblings, 0 replies; 5+ messages in thread
From: Rahguzar @ 2023-06-02 20:00 UTC (permalink / raw)
  To: Peter Oliver; +Cc: emacs-devel


Peter Oliver <p.d.oliver@mavit.org.uk> writes:

> On Wed, 31 May 2023, Rahguzar wrote:
>
> To ensure that Emacs is started before emacsclient, perhaps systemd socket activation is worth investigating.

This should be possible and I think the Emacs user service to start
daemon is a notify service and so maybe just using a systemd service for
activation which depends on the the Emacs service will work. However, I
don't use daemon due anymore to some font issues which I don't remember
very well but basically stem from the fact that daemon has to deal with
both graphical and terminal frames. I only use graphical frames and
starting server after Emacs works better. Due to this I think forcing
people to start daemon just for this might be heavy handed. I am not too
familiar with systemd and have only a faint idea of what a socket is so
this might be off the mark from what you were suggesting.

Rahguzar



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: An emacs based `xdg-desktop-portal` filechooser
  2023-05-31 20:16 An emacs based `xdg-desktop-portal` filechooser Rahguzar
  2023-06-01 18:42 ` Peter Oliver
@ 2023-06-12 11:04 ` James Thomas
  2023-06-12 15:28   ` Rahguzar
  1 sibling, 1 reply; 5+ messages in thread
From: James Thomas @ 2023-06-12 11:04 UTC (permalink / raw)
  To: Rahguzar; +Cc: emacs-devel

Rahguzar wrote:

> Hi All,
>    During the past few weeks, I have been working on an Emacs based
> implementation of filechooser backend of `xdg-desktop-portal`. It is
> very rough around the edges but I have working version at
> https://codeberg.org/rahguzar/filechooser.

Thanks! This is great news for us EXWM users. My 2c below:

> The choices combo boxes are not implemented. I don't what would be a
> good interface for them (suggestions welcome) and I have in my
> (limited) experience.

Ideas: You could ask for it sequentially before or after specifying the
file name. Or in case of choosing a file extension, you could check the
extension in the user input and ask the user to confirm.

> In my opinion minor compared to these is the fact the filechooser
> dialogues are not modal, i.e. you can still freely interact with the
> window that sent the file selection request.

Perhaps you could temporarily rebind 'C-x o', 'mouse-1' etc.

--



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: An emacs based `xdg-desktop-portal` filechooser
  2023-06-12 11:04 ` James Thomas
@ 2023-06-12 15:28   ` Rahguzar
  0 siblings, 0 replies; 5+ messages in thread
From: Rahguzar @ 2023-06-12 15:28 UTC (permalink / raw)
  To: James Thomas; +Cc: emacs-devel


James Thomas <jimjoe@gmx.net> writes:

> Rahguzar wrote:
>
>> Hi All,
>>    During the past few weeks, I have been working on an Emacs based
>> implementation of filechooser backend of `xdg-desktop-portal`. It is
>> very rough around the edges but I have working version at
>> https://codeberg.org/rahguzar/filechooser.
>
> Thanks! This is great news for us EXWM users. My 2c below:
>
>> The choices combo boxes are not implemented. I don't what would be a
>> good interface for them (suggestions welcome) and I have in my
>> (limited) experience.
>
> Ideas: You could ask for it sequentially before or after specifying the
> file name. Or in case of choosing a file extension, you could check the
> extension in the user input and ask the user to confirm.
>

I am generally not too fond of serial prompting so I was looking for
something like a buffer which could show all the choices and the user
could then choose not to interact with it if the defaults are ok.
However since the choices seem rare in my experience (I see that I
missed some words in my sentence saying this above), I think what you
are proposing will be alright. However I am unlikely to work on it
myself anytime soon. PR on the repository implementing this are welcome.

>> In my opinion minor compared to these is the fact the filechooser
>> dialogues are not modal, i.e. you can still freely interact with the
>> window that sent the file selection request.
>
> Perhaps you could temporarily rebind 'C-x o', 'mouse-1' etc.

This is not about an Emacs window but the window for the application
which sent the request. To see this in action you can do `C-o` from a
Firefox window and by default this will show a GTK file picker dialog.
While the dialog is active, you can't interact with the Firefox window.
I don't think it is possible to achieve this from Emacs and I am not
sure behavior is even desirable.

Related to keybinding, I don't use vanilla Emacs keybindings so if you
are using this and the few bindings provided don't mesh well with the
default Emacs ones, feel free to suggest alternatives or make a PR.

Rahguzar



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-12 15:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31 20:16 An emacs based `xdg-desktop-portal` filechooser Rahguzar
2023-06-01 18:42 ` Peter Oliver
2023-06-02 20:00   ` Rahguzar
2023-06-12 11:04 ` James Thomas
2023-06-12 15:28   ` Rahguzar

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).