From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#35726: Further information of line number bug. Date: Wed, 15 May 2019 18:32:30 +0300 Message-ID: <83sgtf91ip.fsf@gnu.org> References: <31B94EDC-5493-464B-BA2F-54A211803AF0@gmail.com> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="127211"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 35726@debbugs.gnu.org, Aaron Jensen To: changqi chen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 15 17:33:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQvuA-000Wt0-FG for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 May 2019 17:33:18 +0200 Original-Received: from localhost ([127.0.0.1]:38752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQvu9-00062R-Gx for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 May 2019 11:33:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQvtw-0005zH-DL for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 11:33:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQvtv-0000Df-Fb for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 11:33:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39663) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQvtv-0000Cv-CJ for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 11:33:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQvtv-00083r-91 for bug-gnu-emacs@gnu.org; Wed, 15 May 2019 11:33:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 May 2019 15:33:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35726 X-GNU-PR-Package: emacs Original-Received: via spool by 35726-submit@debbugs.gnu.org id=B35726.155793436930950 (code B ref 35726); Wed, 15 May 2019 15:33:03 +0000 Original-Received: (at 35726) by debbugs.gnu.org; 15 May 2019 15:32:49 +0000 Original-Received: from localhost ([127.0.0.1]:53205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQvth-000837-Ah for submit@debbugs.gnu.org; Wed, 15 May 2019 11:32:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQvtf-00082v-RV for 35726@debbugs.gnu.org; Wed, 15 May 2019 11:32:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQvta-00089E-Fa; Wed, 15 May 2019 11:32:42 -0400 Original-Received: from [176.228.60.248] (port=4832 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hQvta-0003fU-1t; Wed, 15 May 2019 11:32:42 -0400 In-reply-to: (message from changqi chen on Tue, 14 May 2019 00:21:33 -0400) 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: 209.51.188.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:159346 Archived-At: > From: changqi chen > Date: Tue, 14 May 2019 00:21:33 -0400 > > I use global-display-line-number-mode in my init.el. When I use emacsclient open first buffer, no matter which > mode it is, line number does not show. > I can manually enable it by M-x display-line-number-mode. If I open other file during my first buffer, different > buffer mode, line number shows. Thanks. This is a regression in Emacs 27; the problem doesn't exist in Emacs 26. The reason for this is the fix for bug#24218. It changed the order in which we visit the file and create a new frame: where previously we created the frame first, and only then visited the file, we now visit the file in the original frame, and after that create a new frame with the visiting buffer being the current buffer. Since define-globalized-minor-mode invokes the turn-on function in find-file-hook, both display-line-numbers-mode and linum-mode now see a frame whose 'client' parameter is nil, and refuse to turn themselves on to avoid bug#27210. Thinking about this, I see several possible solutions: 1. Revert the fix for bug#24218 (since it's just an aesthetic issue). Or maybe someone sees how to fix that bug in a way that doesn't change the order of visiting the file and creating the client frame. 2. Modify define-globalized-minor-mode to also use some other hook, like maybe server-after-make-frame-hook. This has a downside that we will need to scan all the buffers on the frame, which might slow down client frame creation. 3. Remove from linum.el and display-line-numbers.el the condition that causes this: (and (daemonp) (null (frame-parameter nil 'client))) I don't think that bug#27210 will affect display-line-numbers, and linum is semi-deprecated. Any other ideas?