all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gregory@heytings.org, xerusx@pm.me, 59388@debbugs.gnu.org
Subject: bug#59388: Open emacsclient file at last line
Date: Sun, 20 Nov 2022 10:49:10 -0800	[thread overview]
Message-ID: <e21ace7c-3181-98ad-6683-9d3049786ee3@gmail.com> (raw)
In-Reply-To: <834juu6qfg.fsf@gnu.org>

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 <jporterbugs@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.





  reply	other threads:[~2022-11-20 18:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-19 11:57 bug#59388: Open emacsclient file at last line Janek F via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19 15:48 ` Eli Zaretskii
2022-11-19 17:10   ` Gregory Heytings
2022-11-19 18:03     ` Eli Zaretskii
2022-11-19 18:07       ` Gregory Heytings
2022-11-19 18:17         ` Eli Zaretskii
2022-11-19 18:21           ` Gregory Heytings
2022-11-19 18:32             ` Eli Zaretskii
2022-11-19 19:05               ` Gregory Heytings
2022-11-19 19:37                 ` Eli Zaretskii
2022-11-19 20:20                   ` Gregory Heytings
2022-11-19 20:08         ` Jim Porter
2022-11-19 20:33           ` Eli Zaretskii
2022-11-19 23:06             ` Jim Porter
2022-11-20  7:22               ` Eli Zaretskii
2022-11-20 18:49                 ` Jim Porter [this message]
2022-11-20 19:00                   ` Eli Zaretskii
2022-11-20 19:37                     ` Jim Porter
2022-11-21  8:55                     ` Jean Louis
2022-11-21 13:36                       ` Eli Zaretskii
2022-11-21 17:50                         ` Jim Porter
2022-11-21  8:52                   ` Jean Louis
2022-11-21 13:35                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e21ace7c-3181-98ad-6683-9d3049786ee3@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=59388@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=gregory@heytings.org \
    --cc=xerusx@pm.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.