unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35726: 27.0.50; global-linum-mode doesn't work in emacsclient in several modes
@ 2019-05-14  2:07 ccQ's Gmail
  2019-05-14  4:21 ` bug#35726: Further information of line number bug changqi chen
  0 siblings, 1 reply; 8+ messages in thread
From: ccQ's Gmail @ 2019-05-14  2:07 UTC (permalink / raw)
  To: 35726



When I in emacsclient, some of modes do not show line-number. I `M-x
global-linum-mode`, emacs shows me `global-linum-mode` disable. Then I
`M-x global-linum-mode` again, then line-nums show.

When I am not in emacsclient, no issues. Only happen in emacsclient.

So far, I find lisp-mode and go-mode has this problem. elpy-mode looks fine.


In GNU Emacs 27.0.50 (build 7, x86_64-apple-darwin18.6.0, NS appkit-1671.50 Version 10.14.5 (Build 18F132))
of 2019-05-13 built on ccQ-rMBP.local
Repository revision: 364d4e156d80bff711d000bdb2e0ac765726c953
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1671
System Description:  Mac OS X 10.14.5

Recent messages:
[yas] Prepared just-in-time loading of snippets (but no snippets found).
ad-handle-definition: ‘er/expand-region’ got redefined
Waiting for git... [2 times]
[yas] Prepared just-in-time loading of snippets successfully.
Turning on magit-auto-revert-mode...done
Starting Emacs daemon.
When done with a buffer, type C-x # [2 times]
previous-line: Beginning of buffer [6 times]
When done with a buffer, type C-x # [2 times]
funcall-interactively: End of buffer

Configured features:
IMAGEMAGICK NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS
THREADS PDUMPER LCMS2 GMP

Important settings:
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp

Minor modes in effect:
  slime-trace-dialog-minor-mode: t
  slime-autodoc-mode: t
  slime-mode: t
  paredit-mode: t
  helm-gtags-mode: t
  pyvenv-mode: t
  TeX-PDF-mode: t
  helm-mode: t
  helm-autoresize-mode: t
  global-magit-file-mode: t
  magit-file-mode: t
  magit-auto-revert-mode: t
  auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  google-this-mode: t
  delete-selection-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  global-auto-complete-mode: t
  auto-complete-mode: t
  override-global-mode: t
  show-paren-mode: t
  global-linum-mode: t
  global-hl-line-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/Users/ccQ/.emacs.d/elpa/lsp-rust-20180305.1308/lsp-rust hides /Users/ccQ/.emacs.d/elpa/lsp-mode-20190512.1847/lsp-rust
~/.emacs.d/opam_link/_opam/share/emacs/site-lisp/merlin-iedit hides /Users/ccQ/.emacs.d/elpa/merlin-20190323.930/merlin-iedit
~/.emacs.d/opam_link/_opam/share/emacs/site-lisp/merlin-cap hides /Users/ccQ/.emacs.d/elpa/merlin-20190323.930/merlin-cap
~/.emacs.d/opam_link/_opam/share/emacs/site-lisp/merlin-ac hides /Users/ccQ/.emacs.d/elpa/merlin-20190323.930/merlin-ac
~/.emacs.d/opam_link/_opam/share/emacs/site-lisp/merlin hides /Users/ccQ/.emacs.d/elpa/merlin-20190323.930/merlin
~/.emacs.d/opam_link/_opam/share/emacs/site-lisp/merlin-imenu hides /Users/ccQ/.emacs.d/elpa/merlin-20190323.930/merlin-imenu
~/.emacs.d/opam_link/_opam/share/emacs/site-lisp/merlin-company hides /Users/ccQ/.emacs.d/elpa/merlin-20190323.930/merlin-company
~/.emacs.d/opam_link/_opam/share/emacs/site-lisp/utop hides /Users/ccQ/.emacs.d/elpa/utop-20181010.2155/utop

Features:
(shadow sort mail-extr emacsbug sendmail winner helm-command helm-elisp
helm-eval edebug backtrace helm-info term/xterm xterm vc-git ac-slime
slime-fancy slime-trace-dialog slime-fontifying-fu slime-package-fu
slime-references slime-compiler-notes-tree slime-scratch
slime-presentations bridge slime-macrostep macrostep slime-mdot-fu
slime-enclosing-context slime-fuzzy slime-fancy-trace
slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc
slime-repl slime-parse slime arc-mode archive-mode pp hyperspec
browse-url paredit helm-gtags pulse init-ocaml ocamlformat init-yaml
yaml-mode init-rust racer pos-tip rust-mode init-js init-web-n-php
ac-php ac-php-core xcscope f php-mode php-project mode-local speedbar
sb-image ezimage dframe cc-langs cc-mode-expansions cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
php-face php web-mode-expansions web-mode disp-table init-haskell
init-swift init-golang init-python py-autopep8 highlight-indentation
company-capf company pcase help-fns radix-tree elpy find-file-in-project
ivy colir ivy-overlay ffap windmove elpy-shell pyvenv eshell esh-cmd
esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
elpy-profile elpy-django s elpy-refactor python-el-fgallina-expansions
python tramp-sh tramp tramp-loaddefs trampver tramp-integration
tramp-compat parse-time ido grep files-x etags fileloop generator xref
project init-markdown markdown-mode color noutline outline init-org
init-dash init-tex tex-mik tex init-helm helm-swoop helm-mode helm-files
helm-buffers helm-occur helm-tags helm-locate helm-grep helm-regexp
helm-utils helm-help helm-types helm-config helm-easymenu helm
helm-source eieio-compat helm-multi-match helm-lib init-shell init-lisp
init-treemacs cus-edit cus-start cus-load wid-edit magit-submodule
magit-obsolete magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff
smerge-mode diff-mode magit-core magit-autorevert autorevert filenotify
magit-margin magit-transient magit-process magit-mode transient
git-commit magit-git magit-section magit-utils crm log-edit message rmc
puny dired dired-loaddefs format-spec rfc822 mml mml-sec epa derived epg
gnus-util rmail rmail-loaddefs text-property-search time-date mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader
pcvs-util add-log with-editor async-bytecomp async shell pcomplete
server google-this url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap delsel expand-region
text-mode-expansions er-basic-expansions expand-region-core
expand-region-custom highlight-symbol multiple-cursors
mc-hide-unmatched-lines-mode mc-separate-operations
rectangular-region-mode mc-mark-pop mc-mark-more mc-cycle-cursors
mc-edit-lines multiple-cursors-core rect yasnippet advice flymake-proc
flymake compile comint ansi-color ring warnings thingatpt elec-pair
flycheck cl-extra find-func help-mode dash auto-complete-config
auto-complete edmacro kmacro popup use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core monokai-theme paren linum hl-line finder-inf
tex-site rx slime-autoloads info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process
emacs)

Memory information:
((conses 16 538582 33907)
(symbols 48 42822 3)
(strings 32 178653 4185)
(string-bytes 1 5384947)
(vectors 16 66174)
(vector-slots 8 781274 35298)
(floats 8 373 350)
(intervals 56 473 81)
(buffers 992 16))





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#35726: Further information of line number bug.
  2019-05-14  2:07 bug#35726: 27.0.50; global-linum-mode doesn't work in emacsclient in several modes ccQ's Gmail
@ 2019-05-14  4:21 ` changqi chen
  2019-05-15 15:32   ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: changqi chen @ 2019-05-14  4:21 UTC (permalink / raw)
  To: 35726

[-- Attachment #1: Type: text/plain, Size: 362 bytes --]

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.

If not use emacsclient, no problem.

Thank you
-- 
written by ccQ

[-- Attachment #2: Type: text/html, Size: 601 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#35726: Further information of line number bug.
  2019-05-14  4:21 ` bug#35726: Further information of line number bug changqi chen
@ 2019-05-15 15:32   ` Eli Zaretskii
  2019-05-15 17:35     ` npostavs
  2019-05-15 19:21     ` Aaron Jensen
  0 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2019-05-15 15:32 UTC (permalink / raw)
  To: changqi chen; +Cc: 35726, Aaron Jensen

> From: changqi chen <ccq777@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?





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#35726: Further information of line number bug.
  2019-05-15 15:32   ` Eli Zaretskii
@ 2019-05-15 17:35     ` npostavs
  2019-05-15 18:05       ` Eli Zaretskii
  2019-05-15 19:21     ` Aaron Jensen
  1 sibling, 1 reply; 8+ messages in thread
From: npostavs @ 2019-05-15 17:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 35726, changqi chen, Aaron Jensen

Eli Zaretskii <eliz@gnu.org> writes:

>  1. Revert the fix for bug#24218 (since it's just an aesthetic issue).

Did you typo the bug number?  I don't see how "server-name,
server-socket-dir and daemon start through systemd socket" relates to
aesthetics.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#35726: Further information of line number bug.
  2019-05-15 17:35     ` npostavs
@ 2019-05-15 18:05       ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2019-05-15 18:05 UTC (permalink / raw)
  To: npostavs; +Cc: 35726, ccq777, aaronjensen

> From: npostavs@gmail.com
> Cc: changqi chen <ccq777@gmail.com>,  35726@debbugs.gnu.org,  Aaron Jensen <aaronjensen@gmail.com>
> Date: Wed, 15 May 2019 13:35:46 -0400
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >  1. Revert the fix for bug#24218 (since it's just an aesthetic issue).
> 
> Did you typo the bug number?

Not me, the commit log message.  The correct bug number is 26995.
Sorry, I trusted the Git log.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#35726: Further information of line number bug.
  2019-05-15 15:32   ` Eli Zaretskii
  2019-05-15 17:35     ` npostavs
@ 2019-05-15 19:21     ` Aaron Jensen
  2019-05-15 22:23       ` bug#35726: 27.0.50; global-linum-mode doesn't work in emacsclient in several modes Noam Postavsky
  1 sibling, 1 reply; 8+ messages in thread
From: Aaron Jensen @ 2019-05-15 19:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 35726, changqi chen

On Wed, May 15, 2019 at 8:32 AM Eli Zaretskii <eliz@gnu.org> wrote:
> 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.

For what it's worth, I'd vote for #3 since linum is semi-deprecated
and I rather like the change, so I'd prefer not to revert it.

Aaron





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#35726: 27.0.50; global-linum-mode doesn't work in emacsclient in several modes
  2019-05-15 19:21     ` Aaron Jensen
@ 2019-05-15 22:23       ` Noam Postavsky
  2019-06-07 14:33         ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Noam Postavsky @ 2019-05-15 22:23 UTC (permalink / raw)
  To: Aaron Jensen; +Cc: 35726, changqi chen

Aaron Jensen <aaronjensen@gmail.com> writes:

>>  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.
>
> For what it's worth, I'd vote for #3 since linum is semi-deprecated
> and I rather like the change, so I'd prefer not to revert it.

I think removing the check from display-line-numbers.el would make
sense, but IMO we should leave it in linum.el because having Emacs
freeze on startup is worse than having to toggle global-linum-mode when
using emacsclient.

Or if we really want to remove it from linum.el, there is my patch at
https://debbugs.gnu.org/27210#28 which can fix that bug without the
above check.






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#35726: 27.0.50; global-linum-mode doesn't work in emacsclient in several modes
  2019-05-15 22:23       ` bug#35726: 27.0.50; global-linum-mode doesn't work in emacsclient in several modes Noam Postavsky
@ 2019-06-07 14:33         ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2019-06-07 14:33 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 35726-done, ccq777, aaronjensen

> From: Noam Postavsky <npostavs@gmail.com>
> Date: Wed, 15 May 2019 18:23:56 -0400
> Cc: 35726@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
>  changqi chen <ccq777@gmail.com>
> 
> Aaron Jensen <aaronjensen@gmail.com> writes:
> 
> >>  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.
> >
> > For what it's worth, I'd vote for #3 since linum is semi-deprecated
> > and I rather like the change, so I'd prefer not to revert it.
> 
> I think removing the check from display-line-numbers.el would make
> sense, but IMO we should leave it in linum.el because having Emacs
> freeze on startup is worse than having to toggle global-linum-mode when
> using emacsclient.

OK, done on the emacs-26 branch; closing.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-06-07 14:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-14  2:07 bug#35726: 27.0.50; global-linum-mode doesn't work in emacsclient in several modes ccQ's Gmail
2019-05-14  4:21 ` bug#35726: Further information of line number bug changqi chen
2019-05-15 15:32   ` Eli Zaretskii
2019-05-15 17:35     ` npostavs
2019-05-15 18:05       ` Eli Zaretskii
2019-05-15 19:21     ` Aaron Jensen
2019-05-15 22:23       ` bug#35726: 27.0.50; global-linum-mode doesn't work in emacsclient in several modes Noam Postavsky
2019-06-07 14:33         ` Eli Zaretskii

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).