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.bugs Subject: bug#59388: Open emacsclient file at last line Date: Sun, 20 Nov 2022 21:00:20 +0200 Message-ID: <83leo54fjv.fsf@gnu.org> References: <835yfb7xo6.fsf@gnu.org> <518ded72c33c3608e35a@heytings.org> <83zgcm7rfg.fsf@gnu.org> <518ded72c37782cf8af5@heytings.org> <4dff4be5-8c53-8d8b-e912-1cf2bb3dff98@gmail.com> <83k03q7khf.fsf@gnu.org> <834juu6qfg.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24980"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gregory@heytings.org, xerusx@pm.me, 59388@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 20 20:01:37 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1owpZR-0006MD-IE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Nov 2022 20:01:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owpYv-0000Jd-0r; Sun, 20 Nov 2022 14:01:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owpYt-0000HP-Dm for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 14:01:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owpYs-0004kG-MW for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 14:01:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owpYs-0007H9-IF for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 14:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Nov 2022 19:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59388 X-GNU-PR-Package: emacs Original-Received: via spool by 59388-submit@debbugs.gnu.org id=B59388.166897083127901 (code B ref 59388); Sun, 20 Nov 2022 19:01:02 +0000 Original-Received: (at 59388) by debbugs.gnu.org; 20 Nov 2022 19:00:31 +0000 Original-Received: from localhost ([127.0.0.1]:44649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owpYC-0007Fn-1S for submit@debbugs.gnu.org; Sun, 20 Nov 2022 14:00:30 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owpY8-0007FU-IX for 59388@debbugs.gnu.org; Sun, 20 Nov 2022 14:00:19 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owpY2-0004Qa-S9; Sun, 20 Nov 2022 14:00:11 -0500 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=sVNxKsWyuCWNjQynsI0Cm8oNNiv3Airdo2lPfNCEfF4=; b=WIa0jAo6ghJN S1ld0Yh48tohIoiEhRtDFPwC11VhQ5svHd4ripF6NDgTcAvtxeiwkSZs/5/UHQJjBusjobUArKEKS fmI1x8s3zyUhfJu3mVDYdIDSjUCrz4ttV5U2Kf3Zi4aqTtMMAC8xQvAGF+XaYyFFzkNMQwtepeSM5 OHNRtvgQ4Mtn/A2NFubJdOExhcJetbP2AbOPDD4YXGnKprZ5oTQGvM6O9VCDFbqYvmdYzmt9iomNX Jp4ZtxoAhovgS6OL+ppgxUIgwwfQGnZNM5V1T4n5+83vs/ZJ6C5gvyddA9nFZaZ1PMsK5L3dj26Y7 SaYqVtTF5g/OOtkM5rz0QA==; Original-Received: from [87.69.77.57] (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 1owpY2-0002u6-3m; Sun, 20 Nov 2022 14:00:10 -0500 In-Reply-To: (message from Jim Porter on Sun, 20 Nov 2022 10:49:10 -0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248462 Archived-At: > Date: Sun, 20 Nov 2022 10:49:10 -0800 > Cc: gregory@heytings.org, xerusx@pm.me, 59388@debbugs.gnu.org > From: Jim Porter > > > Then I think I'm okay with adding --funcall to emacsclient, as a solution > > for this feature request. With the proviso that the named function will be > > called _after_ visiting the named FILE, right? > > Assuming it's possible, I think the most flexible, obvious, and > consistent[1] way for it to work would be to obey the order of the > arguments. So "emacsclient --funcall func file.txt" calls func and then > visits file.txt, whereas "emacsclient file.txt --funcall func" visits > file.txt and then calls func. This won't work, because emacsclient thinks everything after the first FILE cannot be an option. Which is why +LINE:COLUMN FILE works, although LINE and COLUMN refer to FILE that comes after it. We can invoke functions in the order of --funcall's, but they should run after visiting the file. Nothing else makes sense, and was never possible with emacsclient anyway. So I stand by what I wrote: --funcall'ed functions should run after visiting FILE. It's not a problem, as you can see from the implementation of -position in the protocol.