From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.help Subject: Re: Command line open does not use find-file anymore? Date: Mon, 18 Sep 2017 17:47:01 +0200 Message-ID: <87y3pcvwju.fsf@qcore> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1505749711 10557 195.159.176.226 (18 Sep 2017 15:48:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 18 Sep 2017 15:48:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 18 17:48:27 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtyHY-0002QH-LN for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Sep 2017 17:48:24 +0200 Original-Received: from localhost ([::1]:37412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtyHe-0001Uf-C8 for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Sep 2017 11:48:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtyGQ-00019X-WC for help-gnu-emacs@gnu.org; Mon, 18 Sep 2017 11:47:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dtyGN-0000c0-OO for help-gnu-emacs@gnu.org; Mon, 18 Sep 2017 11:47:15 -0400 Original-Received: from [195.159.176.226] (port=59818 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dtyGN-0000ax-Gz for help-gnu-emacs@gnu.org; Mon, 18 Sep 2017 11:47:11 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dtyGD-0007Mb-9o for help-gnu-emacs@gnu.org; Mon, 18 Sep 2017 17:47:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:mZ8u+e7h1PIQ8NWIDxy3F0df2Oo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:114304 Archived-At: "Everton J. Carpes" 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.