From: Bob Proulx <bob@proulx.com>
To: help-gnu-emacs@gnu.org
Subject: Re: $EDITOR to open at file end?
Date: Fri, 6 Mar 2015 17:48:56 -0700 [thread overview]
Message-ID: <20150306171620044258862@bob.proulx.com> (raw)
In-Reply-To: <87lhjbf0lj.fsf@debian.uxu>
Emanuel Berg wrote:
> Alexis writes:
> >> Is there another way to instruct emacs explicitly
> >> to open the file and go to the bottom of the file?
> >
> > Here's another possible kludge:
> >
> > $ emacs -Q --eval "(add-hook 'find-file-hook
> > (lambda () (goto-char (point-max))))"
> >
> > :-)
Thanks for the suggestion. However that -Q is a little harsh. And
rewriting find-file so that every use of it thereafter jumps to the
end of the file is double harsh. It does answer the question very
literally however. Perhaps I should have clarified that everything
else should remain normal. (chuckle) :-)
> I think you can remove that smiley, because that is
> exactly it (or one of many "exactly it" I should say),
> only I got the impression that the OP wanted this for
> opening a specific file, not every file,
To avoid being vague I wanted this for an EDITOR setting for use with
mutt when logging in over ssh to a remote server. This works. But
the 999999 just feels like hack.
In the .mutt/muttrc file:
set editor="emacs +999999"
> and besides he is likely to want his initialization intact (i.e.,
> not the -Q option which I suspected is a leftover from testing the
> command).
Right. Use of -Q is right out! :-)
> So:
> emacs FILE --eval "(goto-char (point-max))"
Something like that sort'a works. It leads me to an acceptable
answer. Obviously I was hoping to use a "string with options"
followed by the filename in a configuration. This requires the
configuration both before and after FILE. I can get there however by
using a helper script. I will call it muttemacs and have it do
something similar to this (written in compact form):
#!/bin/sh
test $# -ne 1 && { echo "Error: too many arguments" 1>&2; exit 1 ;}
file=$1
exec emacs "$file" --eval "(goto-char (point-max))"
> In situations like these it is common to say that it
> is better to keep Emacs up all the time and open files
> from, not with, Emacs. So, let me tell you that it is
> better to keep Emacs up all the time and open files
> from, not with, Emacs. :)
I knew someone would suggest to use an emacs-server with emacsclient
and screen/tmux and other types of suggestions. But I didn't know how
to head that off. Yes I am very much aware of them. I almost always
run emacs inside of a screen session already. I know I can set up to
automatically switch screen windows to the running emacs server
window. All old stuff. But that has nothing to do with wanting this
setup. Doing that just doesn't make sense in the way I need it to
work. I hadn't mentioned mutt before for fear people would suggest
running gnus or emacs-vm instead. But in the end we all like what we
like. And as an fyi heads up to anyone that cares I am losing network
connectivity to my servers in the next two weeks. Everything needs to
pick up and move elsewhere. Which is why I am making these changes.
It is causing me to rework much of the way I do things. I am trying
to keep ahead of things and to remain functional through the upcoming
disruption.
Bob
next prev parent reply other threads:[~2015-03-07 0:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-05 7:29 $EDITOR to open at file end? Bob Proulx
2015-03-05 7:42 ` Alexis
2015-03-05 7:59 ` Philipp Stephani
[not found] ` <mailman.1367.1425541338.31049.help-gnu-emacs@gnu.org>
2015-03-06 0:09 ` Emanuel Berg
2015-03-07 0:48 ` Bob Proulx [this message]
2015-03-07 0:57 ` Bob Proulx
2015-03-07 2:17 ` Alexis
2015-03-07 14:33 ` Robert Thorpe
2015-03-09 0:18 ` Bob Proulx
2015-03-09 2:52 ` Robert Thorpe
2015-03-09 5:14 ` Bob Proulx
2015-03-09 5:39 ` Alexis
[not found] ` <mailman.1547.1425689344.31049.help-gnu-emacs@gnu.org>
2015-03-07 16:17 ` Emanuel Berg
2015-03-08 23:24 ` Bob Proulx
[not found] ` <mailman.1714.1425857102.31049.help-gnu-emacs@gnu.org>
2015-03-09 0:11 ` Emanuel Berg
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150306171620044258862@bob.proulx.com \
--to=bob@proulx.com \
--cc=help-gnu-emacs@gnu.org \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).