From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#59388: Open emacsclient file at last line Date: Sun, 20 Nov 2022 10:49:10 -0800 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13647"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gregory@heytings.org, xerusx@pm.me, 59388@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 20 19:50:27 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 1owpOd-0003MR-3c for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Nov 2022 19:50:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owpOK-0005LL-VA; Sun, 20 Nov 2022 13:50:08 -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 1owpOE-0005LB-Kc for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 13:50:02 -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 1owpOE-0001VX-9W for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 13:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1owpOD-0006ye-QG for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2022 13:50:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Nov 2022 18:50:01 +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.166897016426775 (code B ref 59388); Sun, 20 Nov 2022 18:50:01 +0000 Original-Received: (at 59388) by debbugs.gnu.org; 20 Nov 2022 18:49:24 +0000 Original-Received: from localhost ([127.0.0.1]:44622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owpNc-0006xn-5X for submit@debbugs.gnu.org; Sun, 20 Nov 2022 13:49:24 -0500 Original-Received: from mail-pj1-f45.google.com ([209.85.216.45]:36379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1owpNW-0006xT-N3 for 59388@debbugs.gnu.org; Sun, 20 Nov 2022 13:49:22 -0500 Original-Received: by mail-pj1-f45.google.com with SMTP id a22-20020a17090a6d9600b0021896eb5554so3576435pjk.1 for <59388@debbugs.gnu.org>; Sun, 20 Nov 2022 10:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=k9/pjGF5dPZB3mRwCARvQDjaH0A8s9ordKTXJoDL4Ag=; b=XzMTPlA76vL5LLtiJ94agFrTgh4C1BkNmiNXI49vbpGNbyrKCKUbOqb5bQyOICHgK0 2zbtdC8JbnRdY2zKBGODtuT23owFFzQ+MmXmSn0jNmBiNiEdrXM4r5Y38R5pNsXtma+n QfuzJdr39hXdTaUaMWOVdp0KpyEXUDKNt4K0GOEQAmal98NCVzz5V2az+EwoClkugwyR u7gBISDGD9fdt/1kWZDLCSENbfJ9ZmAsuzLXfZ+yV8TgKwxI5FxoT7ihp96x2CBAi97K 6VStSIcD1Fh9fV4g9vcYumw1QIYT+C8xI+fr/qrmGUgp3ruBuoKFcKrn7tq66ez+Kwjf yKgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=k9/pjGF5dPZB3mRwCARvQDjaH0A8s9ordKTXJoDL4Ag=; b=6ZWJEzvQ29clP5tNHhLs1NW8FUywuw81q/CAH1pYCNde4O9GbybBstvcH3Rew6MsW7 FgKh4dV5o4F28jGsAtgJWuiOyYDS9HPosy8dgRvL9YEKBmE3vPQM4VTZ4FXgCvIveOCY YY5+y+omhRN5SSmBVUuHhOv7bWWFztzeW5m9CStdsIgUZ7hYtJjYZZNqbyrIhhTJzGwO S7KZ/FTqGbRDzyZrlw+DhGgSNadb2wSJBucru2sa+FhUCZf4ClKYLGAyp7W7eN7LbCBr vO1j9A3PGmp52/iu82MNdaQhPFgDGvhIFuGX1BjUZDST0b1MWMawTl6Rn3SjBft3PcyJ Z4bw== X-Gm-Message-State: ANoB5plfNDOlyrSiZHn1ZZwczAJ2iUBt+4/8t92MDIrXfNjRhuPSc90k cAMS4uE1OSEVhbeDDDq3zo8= X-Google-Smtp-Source: AA0mqf49Y8Gd48pVT0d8gCrusO3tzMBp9aWHxVAu/KSDCUgMylgX44DI2T7tGtsE9FhIGJAsrkY+sw== X-Received: by 2002:a17:902:b40b:b0:188:75bb:36d4 with SMTP id x11-20020a170902b40b00b0018875bb36d4mr8723162plr.55.1668970152798; Sun, 20 Nov 2022 10:49:12 -0800 (PST) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id z1-20020a655a41000000b00439c6a4e1ccsm1533051pgs.62.2022.11.20.10.49.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Nov 2022 10:49:12 -0800 (PST) Content-Language: en-US In-Reply-To: <834juu6qfg.fsf@gnu.org> 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:248456 Archived-At: On 11/19/2022 11:22 PM, Eli Zaretskii wrote: >> Date: Sat, 19 Nov 2022 15:06:14 -0800 >> Cc: gregory@heytings.org, xerusx@pm.me, 59388@debbugs.gnu.org >> From: Jim Porter >> >> On 11/19/2022 12:33 PM, Eli Zaretskii wrote: >>> Maybe we don't need to go as far as that discussion led us? Just adding a >>> switch --funcall, to mimic what Emacs has, could be enough? Then we'd be >>> able to say >>> >>> emacsclient -f eob FILE >>> >>> (assuming we also add a function 'eob' to Emacs). >> >> With the caveat that -f is already used for --server-file, I think this >> would be fine. --funcall is a lot simpler to implement than --apply, at >> least from emacsclient. > > 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. The downside of this is that it's a little bit trickier to write an alias for the case in this bug. 'alias edit-end="emacsclient --funcall end-of-buffer"' wouldn't do the right thing. I don't think that's a problem though, since the original proposal had the same limitation: the "+" comes after the file, as in "emacsclient file.txt +". So my suggestion above would work just like the original proposal except that "+" is spelled differently. [1] This is how --funcall works with the regular emacs executable, as far as I can tell.