GNU bug report logs - #59388
Open emacsclient file at last line

Previous Next

Package: emacs;

Reported by: Janek F <xerusx <at> pm.me>

Date: Sat, 19 Nov 2022 15:45:02 UTC

Severity: wishlist

Full log


Message #50 received at 59388 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: gregory <at> heytings.org, xerusx <at> pm.me, 59388 <at> debbugs.gnu.org
Subject: Re: bug#59388: Open emacsclient file at last line
Date: Sun, 20 Nov 2022 10:49:10 -0800
On 11/19/2022 11:22 PM, Eli Zaretskii wrote:
>> Date: Sat, 19 Nov 2022 15:06:14 -0800
>> Cc: gregory <at> heytings.org, xerusx <at> pm.me, 59388 <at> debbugs.gnu.org
>> From: Jim Porter <jporterbugs <at> gmail.com>
>>
>> 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.




This bug report was last modified 2 years and 204 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.