help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Command line open does not use find-file anymore?


From: Everton J. Carpes
Subject: Re: Command line open does not use find-file anymore?
Date: Mon, 18 Sep 2017 14:36:35 -0300

By "command line" I means starting a new emacs session.

I know the +LINE syntax, but it is not useful when you are dealing with
error reports from a lot of tools which by default will present it like
FILENAME:LINE.

The solution putting the "advice" around find-file works when calling
find-file inside emacs and was working until version 25 also from command
line, but it is not working from command line anymore after updating to 25.



On Mon, Sep 18, 2017 at 12:47 PM, Óscar Fuentes <ofv@wanadoo.es> wrote:

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


-- 
Everton J. Carpes


reply via email to

[Prev in Thread] Current Thread [Next in Thread]