[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Command line open does not use find-file anymore?
From: |
Óscar Fuentes |
Subject: |
Re: Command line open does not use find-file anymore? |
Date: |
Mon, 18 Sep 2017 17:47:01 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
"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.