From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#29036: 26.0.90; Feature Request: make "emacsclient +linenum file" rencenter line Date: Sat, 28 Oct 2017 09:49:44 +0300 Message-ID: <83y3nv6a2f.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1509173436 9059 195.159.176.226 (28 Oct 2017 06:50:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 28 Oct 2017 06:50:36 +0000 (UTC) Cc: 29036@debbugs.gnu.org To: Xiaolong Zhang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 28 08:50:30 2017 Return-path: Envelope-to: geb-bug-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 1e8Kwg-0008De-W4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Oct 2017 08:50:15 +0200 Original-Received: from localhost ([::1]:59966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8Kwj-0006ub-0C for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Oct 2017 02:50:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8Kwa-0006tG-5s for bug-gnu-emacs@gnu.org; Sat, 28 Oct 2017 02:50:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e8KwU-0004FT-87 for bug-gnu-emacs@gnu.org; Sat, 28 Oct 2017 02:50:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57538) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e8KwU-0004Eu-52 for bug-gnu-emacs@gnu.org; Sat, 28 Oct 2017 02:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e8KwT-00074V-QS for bug-gnu-emacs@gnu.org; Sat, 28 Oct 2017 02:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Oct 2017 06:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29036 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29036-submit@debbugs.gnu.org id=B29036.150917340127178 (code B ref 29036); Sat, 28 Oct 2017 06:50:01 +0000 Original-Received: (at 29036) by debbugs.gnu.org; 28 Oct 2017 06:50:01 +0000 Original-Received: from localhost ([127.0.0.1]:37986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e8KwS-00074C-Qg for submit@debbugs.gnu.org; Sat, 28 Oct 2017 02:50:00 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e8KwQ-00073w-I4 for 29036@debbugs.gnu.org; Sat, 28 Oct 2017 02:49:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e8KwI-0003zI-4x for 29036@debbugs.gnu.org; Sat, 28 Oct 2017 02:49:53 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8KwI-0003z8-0v; Sat, 28 Oct 2017 02:49:50 -0400 Original-Received: from [176.228.60.248] (port=4102 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e8KwH-00024D-Iw; Sat, 28 Oct 2017 02:49:49 -0400 In-reply-to: (message from Xiaolong Zhang on Sat, 28 Oct 2017 11:30:27 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:139094 Archived-At: > From: Xiaolong Zhang > Date: Sat, 28 Oct 2017 11:30:27 +0800 > > I'm using emacs for LaTeX file editing and emacsclient support the nice command line option "+linenum file" > to "visit file using find-file, then go to line number linenum in it", which works well. > > Is it possible to recenter to linenum at the sametime? This is the default behavior for Notepad++ and I've tried > the "--eval" option, but it won't switch focus to emacs automatically. Emacs recenters by default, so unless you have some customizations which disable that as side effect, it should already do what you want. I just tried the command emacsclient +150 configure.ac and got line 150 centered in the window where Emacs shows the file. If that doesn't work for you, please show the exact recipe. You seem to invoke emacsclient from another program (I tried from the shell prompt), so perhaps there's something in that context which affects the issue; I'm not familiar with "SumatraPDF" and the "inverse search feature". Another possible reason for not recentering is that the file whose name is passed to emacsclient is already visited in Emacs, and the line whose number you pass to emacsclient is already visible in some window, but not at the center of that window. In that case, Emacs will not recenter.