Subject: Re: bug#59388: Open emacsclient file at last line

From: Eli Zaretskii <[email-masked]>
Date: Sat, 19 Nov 2022 22:33:16 +0200

> Date: Sat, 19 Nov 2022 12:08:06 -0800
> Cc: [email-masked], [email-masked]
> From: Jim Porter <[email-masked]>
> 
> 1. Why does --eval do that? You can mix filenames and --eval with the
>     regular emacs program:
> 
>       emacs -Q foo.txt --eval '(message "hi")'
> 
>     Why doesn't emacsclient work similarly? (On the other hand, changing
>     this might break compatibility, so we should be careful here.)

I don't think we can change the semantics of --eval.

> 2. Assuming we don't change --eval as above, maybe the proposed --apply
>     option discussed in bug#57752 could work:
> 
>       emacsclient --apply end-of-buffer -- foo.c
> 
>     I believe this would even work if you defined a shell alias like so:
> 
>       alias edit=end="emacsclient --apply end-of-buffer --"
>       edit-end foo.txt
> 
>     That said, adding --apply to emacsclient (and emacs, too!) seemed
>     like a fair bit of work when I looked at it...

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).