GNU bug report logs - #29036
26.0.90; Feature Request: make "emacsclient +linenum file" rencenter line

Previous Next

Package: emacs;

Reported by: Xiaolong Zhang <xlzhang921 <at> gmail.com>

Date: Sat, 28 Oct 2017 03:31:02 UTC

Severity: wishlist

Found in version 26.0.90

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Xiaolong Zhang <xlzhang921 <at> gmail.com>
Cc: 29036 <at> debbugs.gnu.org
Subject: bug#29036: 26.0.90; Feature Request: make "emacsclient +linenum file" rencenter line
Date: Sat, 28 Oct 2017 09:49:44 +0300
> From: Xiaolong Zhang <xlzhang921 <at> gmail.com>
> 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.




This bug report was last modified 5 years and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.