unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Xiaolong Zhang <xlzhang921@gmail.com>
Cc: 29036@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	[thread overview]
Message-ID: <83y3nv6a2f.fsf@gnu.org> (raw)
In-Reply-To: <CAH5eB77uDG+FR2PT-Uh1WhjD9FfwqVy=e9tadZu9RSBCxYow2Q@mail.gmail.com> (message from Xiaolong Zhang on Sat, 28 Oct 2017 11:30:27 +0800)

> From: Xiaolong Zhang <xlzhang921@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.





  reply	other threads:[~2017-10-28  6:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-28  3:30 bug#29036: 26.0.90; Feature Request: make "emacsclient +linenum file" rencenter line Xiaolong Zhang
2017-10-28  6:49 ` Eli Zaretskii [this message]
2017-10-29 10:57   ` Xiaolong Zhang
2017-10-29 11:18     ` Eli Zaretskii
2017-10-29 11:20       ` Xiaolong Zhang
2019-09-29  0:39 ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83y3nv6a2f.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=29036@debbugs.gnu.org \
    --cc=xlzhang921@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).