GNU bug report logs - #35726
27.0.50; global-linum-mode doesn't work in emacsclient in several modes

Previous Next

Package: emacs;

Reported by: ccQ's Gmail <ccq777 <at> gmail.com>

Date: Tue, 14 May 2019 04:00:04 UTC

Severity: normal

Found in version 27.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: changqi chen <ccq777 <at> gmail.com>
Cc: 35726 <at> debbugs.gnu.org, Aaron Jensen <aaronjensen <at> gmail.com>
Subject: Re: bug#35726: Further information of line number bug.
Date: Wed, 15 May 2019 18:32:30 +0300
> From: changqi chen <ccq777 <at> gmail.com>
> 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?




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

Previous Next


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