SeanHaz · 2022-12-14 17:46
So for example I have example.txt on my desktop and an emacs window open with buffer.txt in the frame. Ideally I would like to click example.txt and then have buffer.txt be replaced by example.txt such that C-x b RET would bring me back to buffer.txt.
HeiWiper · 2022-12-14 19:10
Yes there is a way, you would need to use emacsclient to open files but for that to work i think you would need to start emacs server which can be done through ur init file through the function (start-server)
SeanHaz · 2022-12-14 20:45
That sounds interesting, I'll read up on it and see if I can get it working
Greenskid · 2022-12-14 21:16
While not the direct answer to your question, you can also use drag & drop to open the file in the same Emacs window.
SeanHaz · 2022-12-14 23:09
Thanks for the info, I didn't know that. Might use that if I can't find any other solution
[deleted] · 2022-12-15 00:56
[deleted]
yordanm · 2022-12-15 09:55
Write yourself an advice to find-file or, if that fails, write a replacement of find-file that switches back to the previous buffer immediately after opening.
SeanHaz · 2022-12-15 12:42
It doesn't sound like that would accomplish what I asked about. Will looking into this help me with new windows/frames.
rswgnu · 2022-12-20 05:15
The GNU Hyperbole package has this capability built-in and permanently customizable via its keyboard-driven minibuffer menus. You can specify exactly where you want pathnames displayed when you press M-RETURN on them.
SeanHaz · 2022-12-20 09:29
I'll look into that right now, spent a few hours yesterday trying some of the other suggestions here to no avail.