From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Xiaolong Zhang Newsgroups: gmane.emacs.bugs Subject: bug#29036: 26.0.90; Feature Request: make "emacsclient +linenum file" rencenter line Date: Sun, 29 Oct 2017 18:57:36 +0800 Message-ID: References: <83y3nv6a2f.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1143ec78c7dc23055cad6311" X-Trace: blaine.gmane.org 1509274706 19841 195.159.176.226 (29 Oct 2017 10:58:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 29 Oct 2017 10:58:26 +0000 (UTC) Cc: 29036@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 29 11:58:12 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 1e8lI8-0003ZK-LQ for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Oct 2017 11:58:08 +0100 Original-Received: from localhost ([::1]:35586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8lIF-0002ad-I0 for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Oct 2017 06:58:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e8lI6-0002aY-GU for bug-gnu-emacs@gnu.org; Sun, 29 Oct 2017 06:58:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e8lI2-0000X8-Ig for bug-gnu-emacs@gnu.org; Sun, 29 Oct 2017 06:58:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59329) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e8lI2-0000Ww-FZ for bug-gnu-emacs@gnu.org; Sun, 29 Oct 2017 06:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e8lI2-00058Y-1p for bug-gnu-emacs@gnu.org; Sun, 29 Oct 2017 06:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Xiaolong Zhang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Oct 2017 10:58:02 +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.150927466519723 (code B ref 29036); Sun, 29 Oct 2017 10:58:02 +0000 Original-Received: (at 29036) by debbugs.gnu.org; 29 Oct 2017 10:57:45 +0000 Original-Received: from localhost ([127.0.0.1]:39777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e8lHk-000582-Nl for submit@debbugs.gnu.org; Sun, 29 Oct 2017 06:57:44 -0400 Original-Received: from mail-io0-f170.google.com ([209.85.223.170]:50856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e8lHi-00057q-SS for 29036@debbugs.gnu.org; Sun, 29 Oct 2017 06:57:43 -0400 Original-Received: by mail-io0-f170.google.com with SMTP id 97so21235327iok.7 for <29036@debbugs.gnu.org>; Sun, 29 Oct 2017 03:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DyarOVgcu8ve4U3F6wbAK/zEjkoxZ6almUfZks++FtM=; b=ulVg6WsZeytOvC3uXMX+5eXOsQ3TSQ4Wq45KHHw10ejr94Zl2c8h/j/JFNi6qkIe8c WIPCF+CMxOr4jEMfbw+XE9z39pvRUIbx7sntNvyaC5NOL2H/BgpdDzC3wc0yVSLMI1k8 BSb+2aoSJls+k2862SI3pVh1K7QtbKoZqAoKwkKEC/aQnoI68Jv3dqUsDpUohaEgcn3B G7rU3vRNhbzgOChbxW24kMpyGLLUIqgsCHp3vo3eUHnwMHCXcQ19IvthemSTDfEIbgea OowKUJYFS/olX569a5W8hOzyYwvNEwZMeKqANKcGBvq7g4hlUL9LylMwuxQPbzpbSTuZ twpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DyarOVgcu8ve4U3F6wbAK/zEjkoxZ6almUfZks++FtM=; b=sDGDZyx5u2jKpRb+IJaxGB1VfVWxbL26iNuDUWTkb5X8sBAnWlFKVZQgQak1AOwRZO Xabk/vES4ME/av6k4vo/tJyDzI01uCo8YCZ27hgdqqxX2V8o7FCI7dyu0DKZ9412RUkn tJEJ7esQTyxdNcjdieYMtn9QoXFA69JP74hi8loTaDVI6BUjX/1iea0btBaxxyDWwQhH bek6meJf2zx78n6/rNE2PTJ2+6ILJlDuurNXrizDHyYZaa2TF3ONNYAnttYz0vXJIpFD V9x6PrLQWgtgiWSoTLBBZOPHEwxUfkmJyIXpNcyz/c3yxGF4Zax7ndCTuigra23kbWRI BB+g== X-Gm-Message-State: AMCzsaVmP2d5T6mPKeOeVX8ltxcGTh8NdI9N4IqvN3WAhpNRtLegNidK bCxjeUImC7BAPAKDrlgMDxNrItAhXgxEVZHhEtY= X-Google-Smtp-Source: ABhQp+SK4i1at/XjveiXSg8SmhwWl2fmnXMgYgm6A/qME9ROC+6wNH0uAKxy+odGMgZo4giX+mjMIadzoq4JhSuxEKg= X-Received: by 10.36.64.145 with SMTP id n139mr1913357ita.115.1509274656692; Sun, 29 Oct 2017 03:57:36 -0700 (PDT) Original-Received: by 10.2.65.70 with HTTP; Sun, 29 Oct 2017 03:57:36 -0700 (PDT) In-Reply-To: <83y3nv6a2f.fsf@gnu.org> 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:139140 Archived-At: --001a1143ec78c7dc23055cad6311 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Eli, Thanks. You are right, vanilla =E2=80=8BEmacs indeed recenters a new file b= y 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 wrote: > > 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. > --001a1143ec78c7dc23055cad6311 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Eli,

Thanks. You are right, van= illa =E2=80=8BEmacs indeed recenters a new file by default.=C2=A0
I= 'm using spacemacs, which won't and I'm investigating the probl= em.


If the file is already visited in Ema= cs, it won't recenter. Is it possible to make
Emacs recenter ev= en if it's already visited? I've check with Notepad++, which=C2=A0<= /div>
will recenter even if it's already opened.

Best,
Xiaolong



On Sat, Oct 28, 2017 at 2:49 PM= , Eli Zaretskii <eliz@gnu.org> wrote:
> 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 def= ault behavior for Notepad++ and I've tried
> the "--eval" option, but it won't switch focus to=C2=A0 = 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.=C2=A0 I just tried the command

=C2=A0 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.=C2=A0 You s= eem
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 "i= nverse 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.=C2=A0 In that case, Emacs
will not recenter.

--001a1143ec78c7dc23055cad6311--