Subject: Re: bug#646: emacsclient with no args to behave like -a

From: Jim Porter <[email-masked]>
Date: Thu, 26 Aug 2021 22:06:18 -0700

On 8/26/2021 9:14 PM, Lars Ingebrigtsen wrote:
> Jim Porter <[email-masked]> writes:
> 
>>  From my reading, this is the original reporter's preferred behavior:
>>
>>    1) If Emacs is not currently running
>>       a) `emacsclient file.txt' starts Emacs and opens file.txt
>>       b) `emacsclient' starts Emacs (as though running `emacs')
>>    2) If Emacs is currently running
>>       a) `emacsclient file.txt' opens file.txt in the existing Emacs session
>>       b) `emacsclient' brings some frame in the existing Emacs session
>>       to the foreground
> 
> That's not my reading.  The bug reporter said "It would be nice if
> emacsclient, when called with no arguments, would just run the alternate
> editor."  I.e., emulate the "-a" parameter when called with no
> parameters.
> 
> (He's also using Emacs as the alternate, but that's just a detail.)

Indeed, it's not 100% clear, especially since this is from so long ago 
that I can't quite remember how emacsclient worked back then. However, I 
did a bit of archaeology and found the following passage in a blog post 
from around the same time:

"First, I recommend using the W32 package. W32 has hacked the 
emacsclient in several useful ways. It will start Emacs if it isn't 
already running, it will call "raise-frame" on the Emacs window when 
started, and it permits starting emacsclient without a filename. "[1]

The last bit confirms that Lennart's patched emacsclient *could* work as 
in (2b) above.[2] Whether that's what the original reporter wanted is 
another story (though it's how I interpret it)...

[1] http://emacs-fu.blogspot.com/2009/03/windows-and-daemons.html
[2] Unfortunately, I couldn't find the sources for Emacs+EmacsW32 to 
confirm this.