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


Message #11 received at 29036 <at> debbugs.gnu.org (full text, mbox):

From: Xiaolong Zhang <xlzhang921 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 29036 <at> debbugs.gnu.org
Subject: Re: bug#29036: 26.0.90; Feature Request: make "emacsclient +linenum
 file" rencenter line
Date: Sun, 29 Oct 2017 18:57:36 +0800
[Message part 1 (text/plain, inline)]
Hi Eli,

Thanks. You are right, vanilla ​Emacs indeed recenters a new file by
default.
I'm using spacemacs, which won't and I'm investigating the problem.


If the file is already visited in Emacs, it won't recenter. Is it possible
to make
Emacs recenter even if it's already visited? I've check with Notepad++,
which
will recenter even if it's already opened.

Best,
Xiaolong



On Sat, Oct 28, 2017 at 2:49 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> > 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.
>
[Message part 2 (text/html, inline)]

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.