From: "Óscar Fuentes" <ofv@wanadoo.es>
To: help-gnu-emacs@gnu.org
Subject: Re: Command line open does not use find-file anymore?
Date: Mon, 18 Sep 2017 17:47:01 +0200 [thread overview]
Message-ID: <87y3pcvwju.fsf@qcore> (raw)
In-Reply-To: CAL2=v65uCXhTfLCZsabJu5xce7_03gwOEcZVfDVOr00JkYPgqw@mail.gmail.com
"Everton J. Carpes" <everton.carpes@gmail.com> writes:
> Until emacs 24 I was able to customize file opening using an "advice"
> around find-file. It was working for opening from inside emacs and also
> from command line.
>
> I use this to deal with common error reports, which are presented in
> "filename:lineno" syntax. The suggestion to do this can be found here:
[snip]
By "command line" you refer to starting a new emacs session or invoking
the emacs server with emacsclient?
The documentation says that find-file is used when visiting a file from
the command line (i.e. when you start emacs providing a file name). It
also mentions de syntax +LINE and +LINE:COLUMN for jumping to a specific
positiong. Here is an excerpt from the relevant info node:
C.1 Action Arguments
====================
Here is a table of action arguments:
‘FILE’
‘--file=FILE’
‘--find-file=FILE’
‘--visit=FILE’
Visit FILE using ‘find-file’. *Note Visiting::.
When Emacs starts up, it displays the startup buffer in one window,
and the buffer visiting FILE in another window (*note Windows::).
If you supply more than one file argument, the displayed file is
the last one specified on the command line; the other files are
visited but their buffers are not shown.
If the startup buffer is disabled (*note Entering Emacs::), then
FILE is visited in a single window if one file argument was
supplied; with two file arguments, Emacs displays the files in two
different windows; with more than two file argument, Emacs displays
the last file specified in one window, plus a Buffer Menu in a
different window (*note Several Buffers::). To inhibit using the
Buffer Menu for this, change the variable
‘inhibit-startup-buffer-menu’ to ‘t’.
‘+LINENUM FILE’
Visit FILE using ‘find-file’, then go to line number LINENUM in it.
‘+LINENUM:COLUMNNUM FILE’
Visit FILE using ‘find-file’, then go to line number LINENUM and
put point at column number COLUMNNUM.
next prev parent reply other threads:[~2017-09-18 15:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 9:00 Command line open does not use find-file anymore? Everton J. Carpes
2017-09-18 15:47 ` Óscar Fuentes [this message]
2017-09-18 17:36 ` Everton J. Carpes
2017-09-19 11:38 ` Michael Heerdegen
2017-09-19 16:50 ` Eli Zaretskii
2017-09-20 1:16 ` Everton J. Carpes
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=87y3pcvwju.fsf@qcore \
--to=ofv@wanadoo.es \
--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).