[Top][All Lists]

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

Re: emacs <--> file-browser as coroutines

From: Yuri Khan
Subject: Re: emacs <--> file-browser as coroutines
Date: Mon, 27 Jun 2016 14:18:10 +0600

On Mon, Jun 27, 2016 at 1:09 PM, Rustom Mody <address@hidden> wrote:

> The second (needs first) is more experimental -- its about emacs not using
> its usual C-x C-f method of opening files but calling out to the file
> browser
> [In my experiments that's nautilus]
> Similar on other gnu-linux-variants should be much the same

If you pull down the File menu and select the Open File item there or
click on the Open File button on the toolbar, you will be presented
with an Open File dialog that is specific to and appropriate for your
desktop environment.

    <menu-bar> <file> <open-file> runs the command
    menu-find-file-existing, which is an interactive compiled Lisp
    function in `menu-bar.el'.

The actual code that decides whether to ask for a file name in the
minibuffer or to pop up a dialog is in read-file-name-default and
next-read-file-uses-dialog-p. The latter returns t if the current
frame is graphical, the variables use_file_dialog and use_dialog box
are non-nil, and the command was invoked with the mouse.

You might be able to circumvent that last condition and get
read-file-name-default to use the dialog even if invoked from the

The file manager as such is usually not an appropriate method of
asking for a file name in response to an Open File command; that calls
for a modal dialog. However, the file manager can invoke Emacs or
emacsclient in response to a double-click on a file of a suitable
type, to a menu or context menu command, or a drag-and-drop of a file
into an Emacs window or on an Emacs launcher button or icon. (All of
the above actually works for me in Thunar, provided that I set up file
type associations.)

reply via email to

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