From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to set Emacs as default app on Windows (10) Date: Sun, 22 May 2022 08:52:00 +0300 Message-ID: <83zgja6rnj.fsf@gnu.org> References: <1438128271.3469357.1653181723805@mail1.libero.it> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="803"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Angelo Graziosi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 22 07:55:00 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nseYM-000AZO-AY for ged-emacs-devel@m.gmane-mx.org; Sun, 22 May 2022 07:54:58 +0200 Original-Received: from localhost ([::1]:43168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nseYK-0008LS-MT for ged-emacs-devel@m.gmane-mx.org; Sun, 22 May 2022 01:54:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nseVp-0007BF-9p for emacs-devel@gnu.org; Sun, 22 May 2022 01:52:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36114) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nseVl-0006nZ-Ez; Sun, 22 May 2022 01:52:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=27XBuz2iVY7b0T2WM0vBLZ/FDIbvpG6aLQ9nzDTAbqc=; b=R7G1+tUYeH40 tE3GJGGnRqGIHFPSgkPCylpBsjmC3/HTLmZBZ1JDG2SQiUsuKpYAH5eM+C7IaZ6bTSRIWorJ065Lr WcuVW/WPTBTDFTlQNs1H2hY7q5vesAKfF+kZgbGoAFH2Cxke+UfMv4unDXXkD88CHaWL+bqO4C7cK 3vBMe+syipKXxDc7wvHscTFuGyZdGtERF7UEaMVe/QZALJK0Xf/H5Mb86X6wzORb+oEjbg1JCHhjn KMMQvRqtGk1aosZBKnX8eSUSRvIl7ITollJ6P7F/wHYwLXZp7/EzypG/dG342R4YSLRRiFxBspKMQ isqWgOdQLr6he6mcZsPxSA==; Original-Received: from [87.69.77.57] (port=3765 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nseVk-0000O7-Ua; Sun, 22 May 2022 01:52:17 -0400 In-Reply-To: <1438128271.3469357.1653181723805@mail1.libero.it> (message from Angelo Graziosi on Sun, 22 May 2022 03:08:43 +0200 (CEST)) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290069 Archived-At: > Date: Sun, 22 May 2022 03:08:43 +0200 (CEST) > From: Angelo Graziosi > > Usually I start Emacs with a link in the task bar which has as target: > > C:\Users\utente>C:\Windows\System32\cmd.exe /c "SET path=C:\msys64\mingw64\bin;%path%&& SET PRELOAD_WINSOCK=1&& START /D ^"C:\Apps\Emacs\bin^" runemacs.exe" > > So trying to open a .tex file from explorer, when it asks with which application I want to open that file, I browsed until the bin folder of Emacs and chose emacs.exe. But in this way, if I had stated Emacs from the above link, it opens another frame (and loses also a bit of graphics) and the result is not very good... > > Reading https://www.emacswiki.org/emacs/EmacsMsWindowsIntegration I tried this > > >From a DOS box I started the Emacs client adapting the above target: > > C:\Users\utente>C:\Windows\System32\cmd.exe /c "SET path=C:\msys64\mingw64\bin;%path%&& SET PRELOAD_WINSOCK=1&& START /D ^"C:\Apps\Emacs\bin^" emacsclientw.exe -c -n -a C:\Apps\Emacs\bin\runemacs.exe" I don't understand why you needed to change that target. What was it supposed to achieve, and how is that related to the issue at hand, which is setting up the default application to open *.tex files? > and from a DOS box started as administrator, I did > > ftype CodeFile=emacsclientw -na runemacs "%1" > > assoc .tex=CodeFile > > then tried to open the .tex file from explorer. But the result is as above, with another frame and losing graphics. "Another frame" or "another instance of Emacs"? How many Emacs processes do you have running after you click on a .tex file in the Explorer? > It should open the new file in a new tab in Emacs (already running with the tab-line enabled) as many apps do (consider a browser with a few tabs opened and double clicking in explorer on a .html file..) The tab bar conceptually holds window configurations, not buffers or individual windows. AFAICT, server.el and emacsclient currently don't have an option to visit files in a new tab, they can only visit it either in an existing frame (the default) or in a new frame, if invoked with the -c command-line option.