GNU bug report logs - #71343
30.0.50; TTY frame doesn't automatically redisplay itself after having closed another frame

Previous Next

Package: emacs;

Reported by: Daniel Clemente <n142857 <at> gmail.com>

Date: Mon, 3 Jun 2024 15:56:01 UTC

Severity: normal

Found in version 30.0.50

To reply to this bug, email your comments to 71343 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#71343; Package emacs. (Mon, 03 Jun 2024 15:56:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Daniel Clemente <n142857 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 03 Jun 2024 15:56:01 GMT) Full text and rfc822 format available.

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

From: Daniel Clemente <n142857 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; TTY frame doesn't automatically redisplay itself after
 having closed another frame
Date: Mon, 3 Jun 2024 15:33:16 +0000
This happens since I started using TTY emacs (with no X support)
around 2 months ago. It's easy to reproduce but it may have something
to do with my terminal or window manager.

The problem is that Emacs doesn't redisplay in one particular case.
It's just a minor annoyance because I can just press a key or move the
mouse and the frame will redisplay. But it may hint at some other bug
that could be worthy of fixing.


I can consistently do this to reproduce it:

1. Launch emacs --daemon -Q
2. Using my tiling window manager "wmii", I divide the screen in a
left part and a right part. Each one has other non-Emacs windows
3. In the left side, I press a key to launch a terminal with TTY
emacs. I use a command like this: urxvtcd -e emacsclient -c &
4. I move focus to the right side, I launch another
terminal+emacsclient with the same command
5. Sanity check; verifying that everything works: I move to the left
terminal and press wmii keys to make the terminal wider or thinner. It
works as expected, it redisplays; Emacs uses all available space
inside the X window
6. Now I go to the right side. I press a key to kill the terminal
running emacsclient. Now only the terminal in the left side remains
7. I move to the left side (pressing a wmii key) and I press the wmii
keys to make the terminal wider or thinner (same as step 5). wmii
obeys, the X windows change size as expected.
8. However, the Emacs TTY frame isn't redisplayed: if I made it wider,
the new area at the right of the frame is shown in black (it sometimes
shows garbage from previous attempts). The mode line doesn't extend to
the right. If I make it thinner, the text isn't readjusted to the new
line length. Etc. The cursor keeps blinking.
9. I can keep circulating through other X windows and come back to
this X window, and try to resize it again. It still doesn't redisplay.
Pressing Ctrl also doesn't redisplay it
10. Only when I press a non-modifier key (e.g. right arrow) or I move
the mouse, it redisplays and starts using the whole X window


Note that step 6 is essential. This issue only appears immediately
after having killed another emacslient. It doesn't happen e.g. after
killing another type of X window. Or after having shuffled the X
windows (moving the terminal around, left/right, without killing it).
It's just after killing a frame.



I debugged what does the SIGWINCH handler
(handle_window_change_signal) do in this case (in step 7).
It's run, it does a loop with several ttys, it finds the right one, it
then calls change_frame_size (passing parameter: delay=true), which
just schedules the change (/* We can't deal with the change now, queue
it for later.  */). The change is well scheduled. The problem seems to
be that no redisplay happens after it.


(gdb) n
5972 change_frame_size (f, width, height, false, true, false);
(gdb) s
change_frame_size (f=0x5555597a11e0, new_width=44, new_height=51, pretend=false,
    delay=true, safe=false) at dispnew.c:6085
6085    change_frame_size_1 (f, new_width, new_height, pretend, delay, safe);
(gdb) list
6080 if (!FRAME_WINDOW_P (XFRAME (frame)))
6081  change_frame_size_1 (XFRAME (frame), new_width, new_height,
6082       pretend, delay, safe);
6083    }
6084  else
6085    change_frame_size_1 (f, new_width, new_height, pretend, delay, safe);
6086 }
6087 ^L
6088 /***********************************************************************
6089   Terminal Related Lisp Functions
(gdb) s
change_frame_size_1 (f=0x5555597a11e0, new_width=44, new_height=51,
pretend=false,
    delay=true, safe=false) at dispnew.c:6023
6023  if (delay || (redisplaying_p && !safe))
(gdb) n
6025      if (CONSP (frame_size_history)
(gdb)
6036      f->new_width = new_width;
(gdb) p CONSP (frame_size_history)
$25 = 0
(gdb) n
6037      f->new_height = new_height;
(gdb)
6038      f->new_size_p = true;
(gdb)
6039      delayed_size_change = true;
(gdb)
change_frame_size (f=0x5555597a11e0, new_width=44, new_height=51, pretend=false,
    delay=true, safe=false) at dispnew.c:6086
6086 }
(gdb)
handle_window_change_signal (sig=28) at dispnew.c:5964
5964  FOR_EACH_FRAME (tail, frame)
(gdb) cont

I have reproduced this with and without glyph debug enabled; with -O0
and -O3, and with several builds.

I couldn't reproduce it with xterm but I just tried it for some
seconds. I can try more if it looks like it's a urxvt problem.
My urxvt (rxvt-unicode) is customized but from a first glance I don't
see anything related to this.

If there's a bug, maybe it's in my window manager (wmii) since I know
it has minor focusing bugs. However, Emacs under X didn't have this
problem.



In GNU Emacs 30.0.50 (build 15, x86_64-pc-linux-gnu) of 2024-06-02 built on sonn
Repository revision: d9512da49514623ef3e35524dc894c06f2c0ce20
Repository branch: master
System Description: Devuan GNU/Linux 5 (daedalus)

Configured using:
 'configure --prefix=/opt/dc/emacs/ --without-dbus --with-tiff=no --without-tiff
 --without-libsystemd --without-dbus --with-mailutils
--with-native-compilation --with-x-toolkit=no
 --without-imagemagick --without-xft --without-harfbuzz
--without-freetype --without-libotf
 --without-xwidgets --without-xpm --without-jpeg --without-gif
--without-png --without-webp
 --without-rsvg --without-cairo --without-x
--enable-checking=yes,glyphs 'CFLAGS=-g3 -O0''

Configured features:
GMP GNUTLS LCMS2 LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER SECCOMP SOUND SQLITE3
THREADS XIM ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=SCIM
  locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
  xterm-mouse-mode: t
  erc-track-mode: t
  erc-services-mode: t
  erc-ring-mode: t
  erc-netsplit-mode: t
  erc-menu-mode: t
  erc-match-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-readonly-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-autojoin-mode: t
  erc-networks-mode: t
  savehist-mode: t
  recentf-mode: t
  hexl-follow-ascii: t
  helm-mode: t
  helm-minibuffer-history-mode: t
  async-bytecomp-package-mode: t
  global-git-commit-mode: t
  jdecomp-mode: t
  projectile-mode: t
  global-semantic-decoration-mode: t
  global-semanticdb-minor-mode: t
  global-semantic-show-unmatched-syntax-mode: -1
  semantic-mode: t
  rcirc-track-minor-mode: t
  jabber-activity-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  unpackaged/org-export-html-with-useful-ids-mode: t
  org-superstar-mode: t
  minibuffer-depth-indicate-mode: t
  global-so-long-mode: t
  display-time-mode: t
  global-hl-line-mode: t
  xclip-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  minibuffer-regexp-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/w/helm/helm-files hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-files
/w/helm/helm-comint hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-comint
/w/helm/helm-elisp-package hides
/home/dc/.emacs.d/elpa/helm-20191101.641/helm-elisp-package
/w/helm/helm-external hides
/home/dc/.emacs.d/elpa/helm-20191101.641/helm-external
/w/helm/helm-easymenu hides
/home/dc/.emacs.d/elpa/helm-20191101.641/helm-easymenu
/w/helm/helm-font hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-font
/w/helm/helm-imenu hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-imenu
/w/helm/helm-x-files hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-x-files
/w/helm/helm-regexp hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-regexp
/w/helm/helm-net hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-net
/w/helm/helm-ring hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-ring
/w/helm/helm-find hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-find
/w/helm/helm-misc hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-misc
/w/helm/helm-occur hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-occur
/w/helm/helm-sys hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-sys
/w/helm/helm-types hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-types
/w/helm/helm-elisp hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-elisp
/w/helm/helm-adaptive hides
/home/dc/.emacs.d/elpa/helm-20191101.641/helm-adaptive
/w/helm/helm-shell hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-shell
/w/helm/helm-id-utils hides
/home/dc/.emacs.d/elpa/helm-20191101.641/helm-id-utils
/w/helm/helm-bookmark hides
/home/dc/.emacs.d/elpa/helm-20191101.641/helm-bookmark
/w/helm/helm-mode hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-mode
/w/helm/helm-eshell hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-eshell
/w/helm/helm-dabbrev hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-dabbrev
/w/helm/helm-grep hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-grep
/w/helm/helm-color hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-color
/w/helm/helm-help hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-help
/w/helm/helm-buffers hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-buffers
/w/helm/helm-locate hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-locate
/w/helm/helm-tags hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-tags
/w/helm/helm-autoloads hides
/home/dc/.emacs.d/elpa/helm-20191101.641/helm-autoloads
/w/helm/helm-info hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-info
/w/helm/helm-semantic hides
/home/dc/.emacs.d/elpa/helm-20191101.641/helm-semantic
/w/helm/helm-config hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-config
/w/helm/helm-command hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-command
/w/helm/helm-utils hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-utils
/w/helm/helm-eval hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-eval
/w/helm/helm-for-files hides
/home/dc/.emacs.d/elpa/helm-20191101.641/helm-for-files
/w/helm/helm-man hides /home/dc/.emacs.d/elpa/helm-20191101.641/helm-man
/w/helm/helm-multi-match hides
/home/dc/.emacs.d/elpa/helm-core-20191031.1931/helm-multi-match
/w/helm/helm-lib hides /home/dc/.emacs.d/elpa/helm-core-20191031.1931/helm-lib
/w/helm/helm-source hides
/home/dc/.emacs.d/elpa/helm-core-20191031.1931/helm-source
/w/helm/helm hides /home/dc/.emacs.d/elpa/helm-core-20191031.1931/helm
/home/dc/.emacs.d/elpa/transient-20220717.1713/transient hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/transient
/w/org-mode/lisp/org-fold-core hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-fold-core
/w/org-mode/lisp/ob-haskell hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-haskell
/w/org-mode/lisp/org-plot hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-plot
/w/org-mode/lisp/ox-icalendar hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-icalendar
/w/org-mode/lisp/org-footnote hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-footnote
/w/org-mode/lisp/org-archive hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-archive
/w/org-mode/lisp/ob-exp hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-exp
/w/org-mode/lisp/ob-octave hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-octave
/w/org-mode/lisp/oc-natbib hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/oc-natbib
/w/org-mode/lisp/org-num hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-num
/w/org-mode/lisp/ob-processing hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-processing
/w/org-mode/lisp/org-mouse hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-mouse
/w/org-mode/lisp/ob-core hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-core
/w/org-mode/lisp/ob-awk hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-awk
/w/org-mode/lisp/org-table hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-table
/w/org-mode/lisp/org-lint hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-lint
/w/org-mode/lisp/oc-basic hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/oc-basic
/w/org-mode/lisp/ob-scheme hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-scheme
/w/org-mode/lisp/ox-latex hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-latex
/w/org-mode/lisp/org-loaddefs hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-loaddefs
/w/org-mode/lisp/ob-table hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-table
/w/org-mode/lisp/ob-shell hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-shell
/w/org-mode/lisp/org hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/org
/w/org-mode/lisp/ol-man hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-man
/w/org-mode/lisp/ol-rmail hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-rmail
/w/org-mode/lisp/ox-man hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-man
/w/org-mode/lisp/org-cycle hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-cycle
/w/org-mode/lisp/org-datetree hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-datetree
/w/org-mode/lisp/ol-mhe hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-mhe
/w/org-mode/lisp/ob-css hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-css
/w/org-mode/lisp/org-fold hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-fold
/w/org-mode/lisp/ob-lilypond hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-lilypond
/w/org-mode/lisp/ob-comint hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-comint
/w/org-mode/lisp/ob-plantuml hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-plantuml
/w/org-mode/lisp/ol-bbdb hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-bbdb
/w/org-mode/lisp/ox-ascii hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-ascii
/w/org-mode/lisp/ob-python hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-python
/w/org-mode/lisp/ob-ref hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-ref
/w/org-mode/lisp/ob-js hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-js
/w/org-mode/lisp/ox-md hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-md
/w/org-mode/lisp/oc hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/oc
/w/org-mode/lisp/org-keys hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-keys
/w/org-mode/lisp/org-feed hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-feed
/w/org-mode/lisp/org-capture hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-capture
/w/org-mode/lisp/org-ctags hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-ctags
/w/org-mode/lisp/ob-lob hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-lob
/w/org-mode/lisp/ob-forth hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-forth
/w/org-mode/lisp/ob-clojure hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-clojure
/w/org-mode/lisp/ob-sass hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-sass
/w/org-mode/lisp/ol-eshell hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-eshell
/w/org-mode/lisp/org-timer hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-timer
/w/org-mode/lisp/ob-R hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-R
/w/org-mode/lisp/org-src hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-src
/w/org-mode/lisp/ox-koma-letter hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-koma-letter
/w/org-mode/lisp/ob-tangle hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-tangle
/w/org-mode/lisp/ob-matlab hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-matlab
/w/org-mode/lisp/org-macro hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-macro
/w/org-mode/lisp/ob-makefile hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-makefile
/w/org-mode/lisp/ox-texinfo hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-texinfo
/w/org-mode/lisp/ob-org hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-org
/w/org-mode/lisp/ol-docview hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-docview
/w/org-mode/lisp/org-list hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-list
/w/org-mode/lisp/ob-eval hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-eval
/w/org-mode/lisp/org-element hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-element
/w/org-mode/lisp/ob hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob
/w/org-mode/lisp/ob-sqlite hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-sqlite
/w/org-mode/lisp/org-clock hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-clock
/w/org-mode/lisp/org-compat hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-compat
/w/org-mode/lisp/org-mobile hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-mobile
/w/org-mode/lisp/ol hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol
/w/org-mode/lisp/ob-groovy hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-groovy
/w/org-mode/lisp/org-goto hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-goto
/w/org-mode/lisp/ob-emacs-lisp hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-emacs-lisp
/w/org-mode/lisp/ol-eww hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-eww
/w/org-mode/lisp/org-tempo hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-tempo
/w/org-mode/lisp/oc-csl hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/oc-csl
/w/org-mode/lisp/ob-ruby hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-ruby
/w/org-mode/lisp/org-crypt hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-crypt
/w/org-mode/lisp/ol-irc hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-irc
/w/org-mode/lisp/org-faces hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-faces
/w/org-mode/lisp/ob-latex hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-latex
/w/org-mode/lisp/org-colview hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-colview
/w/org-mode/lisp/ol-bibtex hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-bibtex
/w/org-mode/lisp/ob-lua hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-lua
/w/org-mode/lisp/org-protocol hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-protocol
/w/org-mode/lisp/org-attach-git hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-attach-git
/w/org-mode/lisp/ob-screen hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-screen
/w/org-mode/lisp/org-agenda hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-agenda
/w/org-mode/lisp/org-persist hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-persist
/w/org-mode/lisp/ob-sql hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-sql
/w/org-mode/lisp/ob-gnuplot hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-gnuplot
/w/org-mode/lisp/ob-sed hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-sed
/w/org-mode/lisp/ol-gnus hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-gnus
/w/org-mode/lisp/org-inlinetask hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-inlinetask
/w/org-mode/lisp/ox-html hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-html
/w/org-mode/lisp/oc-biblatex hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/oc-biblatex
/w/org-mode/lisp/org-pcomplete hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-pcomplete
/w/org-mode/lisp/ob-perl hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-perl
/w/org-mode/lisp/org-version hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-version
/w/org-mode/lisp/org-indent hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-indent
/w/org-mode/lisp/org-refile hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-refile
/w/org-mode/lisp/ob-julia hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-julia
/w/org-mode/lisp/ol-info hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-info
/w/org-mode/lisp/ol-doi hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-doi
/w/org-mode/lisp/org-habit hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-habit
/w/org-mode/lisp/org-entities hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-entities
/w/org-mode/lisp/ox-publish hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-publish
/w/org-mode/lisp/org-duration hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-duration
/w/org-mode/lisp/ob-ditaa hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-ditaa
/w/org-mode/lisp/ob-dot hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-dot
/w/org-mode/lisp/ob-C hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-C
/w/org-mode/lisp/ox-org hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-org
/w/org-mode/lisp/ox-beamer hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-beamer
/w/org-mode/lisp/ob-fortran hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-fortran
/w/org-mode/lisp/ob-maxima hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-maxima
/w/org-mode/lisp/ob-eshell hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-eshell
/w/org-mode/lisp/ol-w3m hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ol-w3m
/w/org-mode/lisp/org-id hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-id
/w/org-mode/lisp/ox-odt hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox-odt
/w/org-mode/lisp/ob-java hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-java
/w/org-mode/lisp/ob-calc hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-calc
/w/org-mode/lisp/org-attach hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-attach
/w/org-mode/lisp/ob-ocaml hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-ocaml
/w/org-mode/lisp/oc-bibtex hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/oc-bibtex
/w/org-mode/lisp/ox hides /opt/dc/emacs/share/emacs/30.0.50/lisp/org/ox
/w/org-mode/lisp/ob-lisp hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/ob-lisp
/w/org-mode/lisp/org-macs hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/org/org-macs
/w/flim/sasl hides /opt/dc/emacs/share/emacs/30.0.50/lisp/net/sasl
/home/dc/.emacs.d/elpa/hierarchy-20190425.842/hierarchy hides
/opt/dc/emacs/share/emacs/30.0.50/lisp/emacs-lisp/hierarchy

Features:
(shadow elmo-multi modb-standard elmo-maildir emacsbug helm-dabbrev
perl-mode semantic/tag-file
semantic/bovine/c semantic/decorate/include hideif
semantic/bovine/c-by semantic/lex-spp
semantic/bovine/gcc semantic/bovine semantic/analyze/refs eglot
external-completion jsonrpc flymake
solar cal-dst holidays holiday-loaddefs org-duration cal-iso
face-remap vc vc-hg ffap oc-basic
ol-eww eww url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus
nnselect ol-docview ol-bibtex
bibtex ol-bbdb ol-w3m ol-doi org-link-doi zone zone-select vc-mtn
semantic/db-file data-debug
cedet-files semantic/texi semantic/db-find semantic/db-ref etags
fileloop xref bug-reference texinfo
texinfo-loaddefs helm-git-grep dired-aux loadhist cl-print shortdoc
mule-util help-fns radix-tree
use-package-core cus-start tabify misearch multi-isearch vc-git
vc-dispatcher winner tramp-archive
tramp-gvfs xterm-keybinder xt-mouse term/rxvt term/xterm xterm
hideshow ox-texinfo erc-track
erc-services erc-ring erc-netsplit erc-menu erc-match erc-goodies
erc-pcomplete erc-button erc-fill
erc-stamp erc-join erc erc-backend erc-networks erc-common erc-compat
erc-loaddefs quail rot13
git-link nukneval bustrofedon dired-filetype-face dired-tar gnus-dired
dired-x mime-w3m w3m-lnum w3m
doc-view w3m-hist bookmark-w3m w3m-ems w3m-favicon w3m-image w3m-fb
tab-line w3m-proc w3m-util
savehist tramp-cache time-stamp tramp-sh recentf tree-widget em-term
term ehelp esh-ext esh-proc
esh-opt esh-io esh-arg esh-module esh-groups esh-util jka-compr
binview calc calc-loaddefs calc-macs
hexl taskjuggler-mode skeleton generic generic-x boxquote rect
rainbow-delimiters rainbow-mode fc
flashcard-sm5 flashcard keywiz gamegrid tt-mode helm-mode helm-misc
helm-for-files helm-bookmark
helm-adaptive magit-bookmark bookmark fringe helm-external helm-sys
helm-net helm-man helm-color
helm-elisp helm-files image-dired image-dired-tags
image-dired-external image-dired-util image-mode
exif tramp trampver tramp-integration files-x tramp-message
tramp-compat tramp-loaddefs helm-buffers
helm-occur helm-tags helm-locate helm-grep helm-regexp helm-info
helm-utils helm-types helm-eval
edebug helm-help helm helm-global-bindings helm-easymenu helm-core
async-bytecomp helm-source
helm-multi-match helm-lib async helm-config helm-autoloads diary-lib
diary-loaddefs 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 diff-mode track-changes
git-commit log-edit pcvs-util add-log magit-core magit-autorevert
autorevert filenotify magit-margin
magit-transient magit-process with-editor server magit-mode transient
edmacro kmacro magit-git
magit-base magit-section dash chuck-mode jdecomp arc-mode archive-mode
cus-edit cus-load projectile
lisp-mnt ibuf-ext semantic/dep srecode/mode semantic/senator
semantic/wisent semantic/wisent/wisent
srecode/insert srecode/filters srecode/args ede/speedbar ede/files ede
ede/detect ede/base ede/auto
ede/source eieio-speedbar speedbar dframe eieio-custom srecode/find
srecode/map srecode/ctxt
srecode/compile srecode/dictionary srecode/fields srecode/table
semantic/decorate/mode
semantic/decorate pulse srecode semantic/db-mode semantic/idle
semantic/analyze semantic/sort
semantic/scope semantic/analyze/fcn semantic/db eieio-base
semantic/format ezimage semantic/tag-ls
semantic/find semantic/ctxt semantic/util-modes semantic/util semantic
semantic/tag semantic/lex
semantic/fw mode-local cedet rcirc offlineimap sasl-xoauth2 oauth2
url-http url-auth url-gw nsm
plstore crm wl-template wl-fldmgr wl-score wl-demo wl-thread wl-action
wl wl-draft wl-folder
elmo-nntp elmo-net elmo-cache elmo-map elmo-dop ps-print
ps-print-loaddefs lpr elmo-filter
wl-summary wl-refile wl-message wl-mime mime-play filename mime-edit
mime-setup mail-mime-setup
semi-setup smtp wl-e21 wl-highlight invisible inv-23 elmo-mime
mmelmo-buffer mmelmo-imap mmimap
mmbuffer mime-view mime-conf calist semi-def wl-address pldap wl-util
wl-vars wl-version
modb-generic elmo-flag elmo-localdir elmo elmo-signal elmo-msgdb modb
modb-entity elmo-date
eword-encode mime-parse mime mmgeneric elmo-util eword-decode mel
mime-def alist pces pces-e20
pces-20 mcs-e20 mcs-20 mcharset timezone elmo-vars path-util
elmo-version luna std11 pccl pccl-20
ccl broken static apel-ver product jabber jabber-truncate jabber-time
jabber-autoaway
jabber-vcard-avatars jabber-chatstates jabber-events jabber-vcard
jabber-avatar jabber-activity
jabber-watch jabber-modeline jabber-ahc-presence jabber-ahc
jabber-version jabber-ourversion
jabber-muc-nick-completion hippie-exp jabber-browse jabber-search
jabber-register jabber-roster
jabber-presence jabber-muc jabber-bookmarks jabber-private
jabber-muc-nick-coloring jabber-widget
jabber-disco jabber-chat jabber-history jabber-chatbuffer jabber-alert
jabber-iq jabber-core
jabber-console sgml-mode facemenu jabber-keymap jabber-sasl sasl
sasl-anonymous sasl-login
sasl-plain fsm jabber-logon jabber-conn srv dns starttls tls
jabber-xml jabber-menu jabber-util
goto-addr hexrgb markdown-mode color thingatpt yasnippet org-contacts
gnus-art mm-uu mml2015 mm-view
mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file
svg dom gnus-group gnus-undo
gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source
utf7 nnoo parse-time iso8601
gnus-spec gnus-int gnus-range message sendmail yank-media puny dired
dnd dired-loaddefs rfc822 mml
mml-sec epa epg rfc6068 epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus nnheader
mail-utils range mm-util
mail-prsvr gnus-util org-crypt ob-sqlite ob-sql ob-shell shell ob-ruby
ob-python python project
compat ob-plantuml ob-perl ob-lilypond ob-js ob-haskell ob-gnuplot
ox-odt rng-loc rng-uri rng-parse
rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok
nxml-util ox-latex
ox-icalendar org-agenda ox-html table ox-ascii ox-publish ox ob-dot
ob-ditaa ob-C cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
ob-R org-capture org-attach
org-protocol iimage org-clock cal-move org-inlinetask org-superstar
org-element org-persist xdg
avl-tree generator org-test ert-x ert pp ewoc debug backtrace org-id
org-refile org-element-ast
inline org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-src sh-script smie treesit
executable ob-comint org-pcomplete pcomplete org-list org-footnote
org-faces org-entities time-date
noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table ol
org-fold org-fold-core
org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs
org-version org-compat org-macs
format-spec ibuf-macs ibuffer ibuffer-loaddefs mb-depth comp comp-cstr
warnings comp-run comp-common
rx advice mwheel easy-mmode so-long longlines grep compile
text-property-search comint regexp-opt
ansi-osc ansi-color ring revbufs derived disp-table hide-mode-line
time image hl-line color-theme
wid-edit reporter xclip finder-inf elp boxquote-autoloads
calfw-autoloads calfw-gcal-autoloads
calfw-ical-autoloads calfw-org-autoloads csv-mode-autoloads
debbugs-autoloads emacsql-psql-autoloads
emacsql-autoloads emmet-mode-autoloads feature-mode-autoloads
git-link-autoloads gnuplot-autoloads
google-translate-autoloads haskell-mode-autoloads cl-extra help-mode
helm-sql-connect-autoloads
htmlize-autoloads idle-org-agenda-autoloads jabber-autoloads
fsm-autoloads jdecomp-autoloads
jedi-autoloads jedi-core-autoloads jinja2-mode-autoloads
json-reformat-autoloads jsonian-autoloads
magit-autoloads pcase git-commit-autoloads magit-section-autoloads
mingus-autoloads
libmpdee-autoloads mmm-jinja2-autoloads mmm-mode-autoloads
oauth2-autoloads org-superstar-autoloads
persist-autoloads projectile-autoloads python-environment-autoloads
rcirc-color-autoloads
srv-autoloads cl terraform-mode-autoloads tmr-autoloads transient-autoloads
typescript-mode-autoloads vimrc-mode-autoloads vue-html-mode-autoloads
with-editor-autoloads
xclip-autoloads xterm-keybinder-autoloads yasnippet-autoloads
zone-nyan-autoloads info tool-bar
dash-autoloads package browse-url url url-proxy url-privacy url-expand
url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq
eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt
gv bytecomp byte-compile
url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode tabulated-list replace newcomment
text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer
select mouse jit-lock font-lock
syntax font-core term/tty-colors frame minibuffer nadvice seq simple
cl-generic indonesian
philippine 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 emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray
oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face
macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap
hashtable-print-readable backquote threads inotify lcms2 multi-tty
make-network-process
native-compile emacs)

Memory information:
((conses 16 2587178 277881) (symbols 48 75184 4) (strings 32 356852
19178) (string-bytes 1 14917666)
 (vectors 16 196150) (vector-slots 8 3132209 215133) (floats 8 1636
35165) (intervals 56 51327 3431)
 (buffers 984 212))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71343; Package emacs. (Mon, 03 Jun 2024 16:39:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Clemente <n142857 <at> gmail.com>
Cc: 71343 <at> debbugs.gnu.org
Subject: Re: bug#71343: 30.0.50;
 TTY frame doesn't automatically redisplay itself after having closed
 another frame
Date: Mon, 03 Jun 2024 19:31:02 +0300
> From: Daniel Clemente <n142857 <at> gmail.com>
> Date: Mon, 3 Jun 2024 15:33:16 +0000
> 
> 1. Launch emacs --daemon -Q
> 2. Using my tiling window manager "wmii", I divide the screen in a
> left part and a right part. Each one has other non-Emacs windows
> 3. In the left side, I press a key to launch a terminal with TTY
> emacs. I use a command like this: urxvtcd -e emacsclient -c &
> 4. I move focus to the right side, I launch another
> terminal+emacsclient with the same command
> 5. Sanity check; verifying that everything works: I move to the left
> terminal and press wmii keys to make the terminal wider or thinner. It
> works as expected, it redisplays; Emacs uses all available space
> inside the X window
> 6. Now I go to the right side. I press a key to kill the terminal
> running emacsclient. Now only the terminal in the left side remains
> 7. I move to the left side (pressing a wmii key) and I press the wmii
> keys to make the terminal wider or thinner (same as step 5). wmii
> obeys, the X windows change size as expected.
> 8. However, the Emacs TTY frame isn't redisplayed: if I made it wider,
> the new area at the right of the frame is shown in black (it sometimes
> shows garbage from previous attempts). The mode line doesn't extend to
> the right. If I make it thinner, the text isn't readjusted to the new
> line length. Etc. The cursor keeps blinking.
> 9. I can keep circulating through other X windows and come back to
> this X window, and try to resize it again. It still doesn't redisplay.
> Pressing Ctrl also doesn't redisplay it
> 10. Only when I press a non-modifier key (e.g. right arrow) or I move
> the mouse, it redisplays and starts using the whole X window
> 
> 
> Note that step 6 is essential. This issue only appears immediately
> after having killed another emacslient. It doesn't happen e.g. after
> killing another type of X window. Or after having shuffled the X
> windows (moving the terminal around, left/right, without killing it).
> It's just after killing a frame.

What do you mean by "kill the terminal running emacsclient" in step 6?

Also, since you mention the window manager, does it mean the problem
doesn't happen with other window managers, if you start 2 emacsclient
sessions with the same daemon and then "kill" (whatever that means)
one of these two sessions?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71343; Package emacs. (Thu, 06 Jun 2024 11:55:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Clemente <n142857 <at> gmail.com>,
 Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 71343 <at> debbugs.gnu.org
Subject: Re: bug#71343: 30.0.50;
 TTY frame doesn't automatically redisplay itself after having closed
 another frame
Date: Thu, 06 Jun 2024 14:54:02 +0300
> From: Daniel Clemente <n142857 <at> gmail.com>
> Date: Mon, 3 Jun 2024 15:33:16 +0000
> 
> This happens since I started using TTY emacs (with no X support)
> around 2 months ago. It's easy to reproduce but it may have something
> to do with my terminal or window manager.
> 
> The problem is that Emacs doesn't redisplay in one particular case.
> It's just a minor annoyance because I can just press a key or move the
> mouse and the frame will redisplay. But it may hint at some other bug
> that could be worthy of fixing.
> 
> 
> I can consistently do this to reproduce it:
> 
> 1. Launch emacs --daemon -Q
> 2. Using my tiling window manager "wmii", I divide the screen in a
> left part and a right part. Each one has other non-Emacs windows
> 3. In the left side, I press a key to launch a terminal with TTY
> emacs. I use a command like this: urxvtcd -e emacsclient -c &
> 4. I move focus to the right side, I launch another
> terminal+emacsclient with the same command
> 5. Sanity check; verifying that everything works: I move to the left
> terminal and press wmii keys to make the terminal wider or thinner. It
> works as expected, it redisplays; Emacs uses all available space
> inside the X window
> 6. Now I go to the right side. I press a key to kill the terminal
> running emacsclient. Now only the terminal in the left side remains
> 7. I move to the left side (pressing a wmii key) and I press the wmii
> keys to make the terminal wider or thinner (same as step 5). wmii
> obeys, the X windows change size as expected.
> 8. However, the Emacs TTY frame isn't redisplayed: if I made it wider,
> the new area at the right of the frame is shown in black (it sometimes
> shows garbage from previous attempts). The mode line doesn't extend to
> the right. If I make it thinner, the text isn't readjusted to the new
> line length. Etc. The cursor keeps blinking.
> 9. I can keep circulating through other X windows and come back to
> this X window, and try to resize it again. It still doesn't redisplay.
> Pressing Ctrl also doesn't redisplay it
> 10. Only when I press a non-modifier key (e.g. right arrow) or I move
> the mouse, it redisplays and starts using the whole X window
> 
> 
> Note that step 6 is essential. This issue only appears immediately
> after having killed another emacslient. It doesn't happen e.g. after
> killing another type of X window. Or after having shuffled the X
> windows (moving the terminal around, left/right, without killing it).
> It's just after killing a frame.

I'm not sure this is a bug.  Emacs switches to reading input from a
different terminal/keyboard when there's actually some input from that
terminal's keyboard.  In the situation you described, the terminal
whose keyboard was active was killed.  I'm guessing we get SIGHUP in
this case, so we could do something about it, but what exactly should
we do?  Since no other keyboard provided any input, to which keyboard
to switch, and why?

So I think we should not change this behavior, since the "workaround"
is so easy.

Paul, any other ideas or comments?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71343; Package emacs. (Thu, 06 Jun 2024 13:25:02 GMT) Full text and rfc822 format available.

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

From: Daniel Clemente <n142857 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 71343 <at> debbugs.gnu.org
Subject: Re: bug#71343: 30.0.50; TTY frame doesn't automatically redisplay
 itself after having closed another frame
Date: Thu, 6 Jun 2024 13:22:45 +0000
> What do you mean by "kill the terminal running emacsclient" in step 6?

Pressing a wmii key, that closes the X window. I don' know which
signal it sends, but kill -SIGQUIT pid also reproduces this issue.

I found an easier way to reproduce it. No left/right columns needed

1. Using X (I reproduced this in wmii and icewm; more on this below)
2. emacs --fg-daemon -Q
3. I run this command twice: urxvt -e 'emacsclient' '-c' &. Now I have
2 X windows running, and emacsclient works fine in both (including
resizing the X window)
4. I go to the last one of those two
5. I press the window manager key to close the window, this kills
urxvt  with the emacsclient that's running inside
6. I see the other X window (the first one) with emacsclient inside,
but it doesn't refresh. If I resize it, black space or garbage
appears. In some rare cases it gets messy: the text of the line I'm
editing (where the cursor is) doesn't appear in the cursor line but
somewhere else, e.g. 1 line below. In those cases I need to restart
something, maybe the daemon.



> Also, since you mention the window manager, does it mean the problem
> doesn't happen with other window managers, if you start 2 emacsclient
> sessions with the same daemon and then "kill" (whatever that means)
> one of these two sessions?

I just reproduced the same in icewm.

Killing the 2nd window, and then resizing the 1st one to make it
wider, the new areas are black.

There may be some details or differences because I'm not familiar with icewm.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71343; Package emacs. (Thu, 06 Jun 2024 13:27:01 GMT) Full text and rfc822 format available.

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

From: Daniel Clemente <n142857 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 71343 <at> debbugs.gnu.org
Subject: Re: bug#71343: 30.0.50; TTY frame doesn't automatically redisplay
 itself after having closed another frame
Date: Thu, 6 Jun 2024 13:24:59 +0000
Note that I just posted a simpler way to understand this bug. No need
to read the complex recipe with left/right columns.

> I'm not sure this is a bug.  Emacs switches to reading input from a
> different terminal/keyboard when there's actually some input from that
> terminal's keyboard.  In the situation you described, the terminal
> whose keyboard was active was killed.  I'm guessing we get SIGHUP in
> this case, so we could do something about it, but what exactly should
> we do?  Since no other keyboard provided any input, to which keyboard
> to switch, and why?

Random ideas, without knowing much about terminals.
- Can't an X terminal detect „I've been given X focus“ and pass this
signal to the program running inside it?
- What if, when closing a TTY frame in emacsclient, all other frames
are redisplayed
- What if, when resizing the frame (something which Emacs detects),
Emacs knows/detects that a frame was closed, and decides not to delay
the redisplay?

It's ok if it can't be fixed. I'm surprised that others didn't have
this issue; but maybe not many are running TTY emacs (no X) inside an
X window.

I'm concerned about preventing cases in which the lack of redisplay
can cause larger problems like mangled text. I just posted a comment
at 71289 about a redisplay bug I saw, but I don't know whether it's
related to closing or to resizing frames.
Hopefully this issue (71343) can't cause mangled text in any situation.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71343; Package emacs. (Thu, 06 Jun 2024 13:45:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Clemente <n142857 <at> gmail.com>
Cc: eggert <at> cs.ucla.edu, 71343 <at> debbugs.gnu.org
Subject: Re: bug#71343: 30.0.50; TTY frame doesn't automatically redisplay
 itself after having closed another frame
Date: Thu, 06 Jun 2024 16:44:00 +0300
> From: Daniel Clemente <n142857 <at> gmail.com>
> Date: Thu, 6 Jun 2024 13:24:59 +0000
> Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 71343 <at> debbugs.gnu.org
> 
> Random ideas, without knowing much about terminals.
> - Can't an X terminal detect „I've been given X focus“ and pass this
> signal to the program running inside it?

You assume that it will be a terminal belonging to Emacs that will get
focus?  That is not given.

> - What if, when closing a TTY frame in emacsclient, all other frames
> are redisplayed

Why?

> - What if, when resizing the frame (something which Emacs detects),
> Emacs knows/detects that a frame was closed, and decides not to delay
> the redisplay?

Redisplay of which frame?  Emacs only redisplays a frame if some
change in buffer text justifies that.

> It's ok if it can't be fixed. I'm surprised that others didn't have
> this issue; but maybe not many are running TTY emacs (no X) inside an
> X window.

It is a rare and not very interesting situation: users aren't expected
to kill terminals, they are expected to "C-x #" to close Emacs
displays.

> I'm concerned about preventing cases in which the lack of redisplay
> can cause larger problems like mangled text.

Lack of redisplay cannot possibly produce garbled text because only
displaying something can do that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71343; Package emacs. (Sun, 16 Jun 2024 05:42:02 GMT) Full text and rfc822 format available.

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

From: Daniel Clemente <n142857 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: eggert <at> cs.ucla.edu, 71343 <at> debbugs.gnu.org
Subject: Re: bug#71343: 30.0.50; TTY frame doesn't automatically redisplay
 itself after having closed another frame
Date: Sun, 16 Jun 2024 05:40:12 +0000
I have a new discovery (it's about „initial frame“), you can skip to
the gdb info below (line 16876).


> > Random ideas, without knowing much about terminals.
> > - Can't an X terminal detect „I've been given X focus“ and pass this
> > signal to the program running inside it?
>
> You assume that it will be a terminal belonging to Emacs that will get
> focus?  That is not given.
>

I was thinking that maybe X always does this (X notifies the terminal
emulator, which notifies the program running inside it, whatever
program it is).
I brainstorm ideas without X knowledge; please ignore the bad ones.
But I think „window focus“ isn't the main issue here; more on this below.

> > - What if, when closing a TTY frame in emacsclient, all other frames
> > are redisplayed
>
> Why?

This one is a bad idea, or a last resort solution, in case there's no
other way to detect that some frames (or which ones) may need to be
refreshed.

>
> > - What if, when resizing the frame (something which Emacs detects),
> > Emacs knows/detects that a frame was closed, and decides not to delay
> > the redisplay?
>
> Redisplay of which frame?  Emacs only redisplays a frame if some
> change in buffer text justifies that.

I propose it should repaint/redisplay the frame whose size changed.
Maybe I'm not using the right word, „redisplay“. What I mean is that
it should refresh its contents („frame redraw“ I think it's called) to
use the new size. For instance if I make the frame wider, now there's
more space, more words fit in each line, the minibuffer needs to be
extended to the right. Even if the buffer text didn't change.
I have 2 frames, kill the 2nd one, and resize the 1st one. Right now,
Emacs is indeed running adjust_frame_size, and it decides not to
repaint the contents; instead it leaves black areas. (Just in this
case after having closed a frame). This does seem like a bug, because
any type of frame size change should trigger a refresh to use the new
size.

Don't we know which frame is the one being resized? It should be f in
adjust_frame_size. It realizes that e.g. it's being resized from 72 to
61 columns.

(gdb) info locals
w = 0x7fffffffc000
text_area_y = -16112
text_area_x = -16288
text_area_width = -16128
text_area_height = 1102416563
unit_width = 1
unit_height = 1
old_native_width = 72
old_native_height = 50
new_native_width = 61
new_native_height = 50
min_inner_width = 2
min_inner_height = 4
r = 0x62100022d130
old_inner_width = 72
old_inner_height = 49
new_inner_width = 61
new_inner_height = 49
old_text_cols = 72
old_text_lines = 49
new_text_cols = 61
new_text_lines = 49
old_text_width = 72
old_text_height = 49
inhibit_horizontal = true
inhibit_vertical = true
frame = XIL(0x621000181105)

And yet it doesn't redraw.
I'm still learning the internals to be able to understand what
happens. resize_frame_windows does its job. pool_changed_p (in
adjust_frame_glyphs_for_frame_redisplay) is true. display_completed is
true. FRAME_GARBAGED_P (f) is true. Later in do_pending_window_change
delayed_size_change is false. When later I press a key,
clear_garbaged_frames is run (invoked by redisplay_internal)

In normal conditions, resizing a frame calls: adjust_frame size, then
redisplay_internal, then clear_garbaged_frames, then redraw_frame

But when I reproduce this bug (i.e. just after closing a frame),
resizing a frame calls: adjust_frame_size, then redisplay_internal. It
doesn't call the other two.
(Only later when I press a key, it calls redisplay_internal, then
clear_garbaged_frames, then redraw_frame)
In this scenario, why doesn't redisplay_internal reach the point where
it calls clear_garbaged_frames?
Because this happens:
Breakpoint 5, redisplay_internal () at xdisp.c:16831
16831      struct window *w = XWINDOW (selected_window);
(gdb) n
16835      bool must_finish = false, match_p;
(gdb)
16839      bool polling_stopped_here = false;
(gdb)
16846      int hscroll_retries = 0;
(gdb)
16854      int garbaged_frame_retries = 0;
(gdb)
16862      bool update_miniwindow_p = false;
(gdb)
16864      redisplay_trace ("redisplay_internal %d\n", redisplaying_p);
(gdb)
16870      if (redisplaying_p)
(gdb)
16876      if ((FRAME_INITIAL_P (SELECTED_FRAME ())
(gdb)
16877           && redisplay_skip_initial_frame)
(gdb)
16879        return;
(gdb)


So, apparently it thinks that my frame is initial.

But from a first view, that doesn't look right. The frame I'm resizing
isn't initial.
It even has a glyph matrix, 2 windows, …
If I open 4 frames, close the 4th one and resize the 3rd one, it sees
it as initial.

This part of the code is new to me. I'll research it more but I wanted
to send this information now.

I have also seen that some of my frames have f->terminal->name =
"initial_terminal", I don't know if that's related or bad.

Some more data about the looks-initial frame:

(gdb) p *SELECTED_FRAME()
$102 = {
  header = {
    size = 4611686018595348501
  },
  name = XIL(0x555557e78944),
  icon_name = XIL(0),
  title = XIL(0),
  last_mouse_device = XIL(0),
  focus_frame = XIL(0),
  root_window = XIL(0x621000004125),
  selected_window = XIL(0x621000004125),
  old_selected_window = XIL(0x621000004125),
  minibuffer_window = XIL(0x6210000043bd),
  param_alist = XIL(0x7ffff18bc633),
  scroll_bars = XIL(0),
  condemned_scroll_bars = XIL(0),
  menu_bar_items = XIL(0x6210000ca905),
  face_hash_table = XIL(0x621000004655),
  menu_bar_vector = XIL(0),
  buffer_predicate = XIL(0),
  buffer_list = XIL(0x7ffff00cbe23),
  buried_buffer_list = XIL(0),
  tool_bar_position = XIL(0xfab0),
  tab_bar_items = XIL(0),
  tool_bar_items = XIL(0),
  face_cache = 0x604000000ad0,
  last_tab_bar_item = 0,
  menu_bar_items_used = 0,
  current_pool = 0x603000002fe0,
  desired_pool = 0x603000002fb0,
  desired_matrix = 0x616000001280,
  current_matrix = 0x616000001580,
  glyphs_initialized_p = true,
  resized_p = false,
  default_face_done_p = false,
  already_hscrolled_p = false,
  updated_p = false,
  fonts_changed = false,
  cursor_type_changed = false,
  redisplay = true,
  visible = 1,
  iconified = false,
  garbaged = false,
  wants_modeline = true,
  auto_raise = false,
  auto_lower = false,
  no_split = false,
  explicit_name = false,
  window_change = false,
  window_state_change = false,
  mouse_moved = false,
  pointer_invisible = false,
  frozen_window_starts = false,
  output_method = output_initial,
  can_set_window_size = true,
  after_make_frame = true,
  tab_bar_redisplayed = false,
  tab_bar_resized = false,
--Type <RET> for more, q to quit, c to continue without paging--
  tool_bar_redisplayed = false,
  tool_bar_resized = false,
  inhibit_horizontal_resize = false,
  inhibit_vertical_resize = false,
  face_change = true,
  inhibit_clear_image_cache = false,
  new_size_p = false,
  was_invisible = false,
  select_mini_window_flag = false,
  change_stamp = 14,
  number_of_windows = 2,
  tab_bar_lines = 0,
  tab_bar_height = 0,
  n_tab_bar_rows = 0,
  n_tab_bar_items = 0,
  tool_bar_lines = 0,
  tool_bar_height = 0,
  n_tool_bar_rows = 0,
  n_tool_bar_items = 0,
  decode_mode_spec_buffer = 0x613000002f80 '\276' <repeats 200 times>...,
  insert_line_cost = 0x0,
  delete_line_cost = 0x0,
  insert_n_lines_cost = 0x0,
  delete_n_lines_cost = 0x0,
  text_cols = 80,
  text_lines = 24,
  text_width = 80,
  text_height = 24,
  total_cols = 80,
  total_lines = 25,
  pixel_width = 80,
  pixel_height = 25,
  new_width = -1,
  new_height = -1,
  left_pos = 0,
  top_pos = 0,
  win_gravity = 0,
  size_hint_flags = 0,
  border_width = 0,
  child_frame_border_width = 0,
  internal_border_width = 0,
  right_divider_width = 0,
  bottom_divider_width = 0,
  left_fringe_width = 0,
  right_fringe_width = 0,
  fringe_cols = 0,
  menu_bar_lines = 1,
  menu_bar_height = 1,
  column_width = 1,
  line_height = 1,
  terminal = 0x621000003d00,
  output_data = {
    tty = 0x0,
    x = 0x0,
    w32 = 0x0,
    ns = 0x0,
    pgtk = 0x0,
    haiku = 0x0,
--Type <RET> for more, q to quit, c to continue without paging--
    android = 0x0
  },
  font_driver_list = 0x0,
  desired_cursor = FILLED_BOX_CURSOR,
  cursor_width = 0,
  blink_off_cursor = FILLED_BOX_CURSOR,
  blink_off_cursor_width = 0,
  config_scroll_bar_width = 0,
  config_scroll_bar_cols = 0,
  config_scroll_bar_height = 0,
  config_scroll_bar_lines = 0,
  cost_calculation_baud_rate = 0,
  alpha = {0, 0},
  alpha_background = 0,
  gamma = 0,
  extra_line_spacing = 0,
  background_pixel = 18446744073709551613,
  foreground_pixel = 18446744073709551614
}
(gdb) p SELECTED_FRAME()->output_data
$103 = {
  tty = 0x0,
  x = 0x0,
  w32 = 0x0,
  ns = 0x0,
  pgtk = 0x0,
  haiku = 0x0,
  android = 0x0
}
(gdb) p Vframe_list
$104 = XIL(0x7ffff18f6c63)
(gdb) xlist
$105 = 0x6210000175bd
Lisp_Vectorlike
PVEC_FRAME
$106 = (struct frame *) 0x6210000175b8
"F2"
No symbol "PVEC_TS_QUERY" in current context.
(gdb)


If I run (set redisplay_skip_initial_frame nil), then **everything
works as expected**. It redraws well when I resize the terminal. No
black areas visible.
But I want the root issue; I still want to know why it's ¿wrongly?
classified as initial. And then fix that.


So I think this issue (71343) isn't about X focus (we're dealing with
TTYs anyway); it's about how to react to frame size changes. And right
now it's about why it unexpectedly seems a frame as initial frame.



>
> > It's ok if it can't be fixed. I'm surprised that others didn't have
> > this issue; but maybe not many are running TTY emacs (no X) inside an
> > X window.:
>
> It is a rare and not very interesting situation: users aren't expected
> to kill terminals, they are expected to "C-x #" to close Emacs
> displays.
>

By the way, C-x # isn't enough to close any Emacs frame. If I have
opened it by running   urxvtcd -e 'emacsclient' '-nw', then later C-x
# doesn't close it, it just says „No server buffers remain to edit“.
But C-x C-c does close it.

The non-repainting issues described above also happen if I close
emacsclient gracefully by C-x C-c. No killing (SIGHUP, SIGKILL, …) is
needed.

Anyway, it seems the problem may be not in the closing, but in the
resizing+redisplaying of the frame that's left. And in the
initial-frame thing, which I'll keep tracing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71343; Package emacs. (Sun, 16 Jun 2024 06:34:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daniel Clemente <n142857 <at> gmail.com>
Cc: eggert <at> cs.ucla.edu, 71343 <at> debbugs.gnu.org
Subject: Re: bug#71343: 30.0.50; TTY frame doesn't automatically redisplay
 itself after having closed another frame
Date: Sun, 16 Jun 2024 09:33:06 +0300
> From: Daniel Clemente <n142857 <at> gmail.com>
> Date: Sun, 16 Jun 2024 05:40:12 +0000
> Cc: eggert <at> cs.ucla.edu, 71343 <at> debbugs.gnu.org
> 
> I have a new discovery (it's about „initial frame“), you can skip to
> the gdb info below (line 16876).

It's a problematic discovery from where I stand...

> > > Random ideas, without knowing much about terminals.
> > > - Can't an X terminal detect „I've been given X focus“ and pass this
> > > signal to the program running inside it?
> >
> > You assume that it will be a terminal belonging to Emacs that will get
> > focus?  That is not given.
> 
> I was thinking that maybe X always does this (X notifies the terminal
> emulator, which notifies the program running inside it, whatever
> program it is).

Emacs doesn't really talk to the terminal emulator, unless the
emulator supports known protocols of doing so.  You will see in
lisp/term/xterm.el that Emacs supports that for xterm that is new
enough.  Don't know what happens with urxvt, but did you try using
xterm and saw the same problems?

> > > - What if, when resizing the frame (something which Emacs detects),
> > > Emacs knows/detects that a frame was closed, and decides not to delay
> > > the redisplay?
> >
> > Redisplay of which frame?  Emacs only redisplays a frame if some
> > change in buffer text justifies that.
> 
> I propose it should repaint/redisplay the frame whose size changed.

When a frame is resized, it is redisplayed, yes.  But that requires
Emacs to know that it is resized.

> Don't we know which frame is the one being resized? It should be f in
> adjust_frame_size. It realizes that e.g. it's being resized from 72 to
> 61 columns.

I need a backtrace showing the call to adjust_frame_size, of a frame
that is not redrawn.  I don't think I saw such a backtrace.

> In normal conditions, resizing a frame calls: adjust_frame size, then
> redisplay_internal, then clear_garbaged_frames, then redraw_frame
> 
> But when I reproduce this bug (i.e. just after closing a frame),
> resizing a frame calls: adjust_frame_size, then redisplay_internal. It
> doesn't call the other two.
> (Only later when I press a key, it calls redisplay_internal, then
> clear_garbaged_frames, then redraw_frame)
> In this scenario, why doesn't redisplay_internal reach the point where
> it calls clear_garbaged_frames?
> Because this happens:
> Breakpoint 5, redisplay_internal () at xdisp.c:16831
> 16831      struct window *w = XWINDOW (selected_window);
> (gdb) n
> 16835      bool must_finish = false, match_p;
> (gdb)
> 16839      bool polling_stopped_here = false;
> (gdb)
> 16846      int hscroll_retries = 0;
> (gdb)
> 16854      int garbaged_frame_retries = 0;
> (gdb)
> 16862      bool update_miniwindow_p = false;
> (gdb)
> 16864      redisplay_trace ("redisplay_internal %d\n", redisplaying_p);
> (gdb)
> 16870      if (redisplaying_p)
> (gdb)
> 16876      if ((FRAME_INITIAL_P (SELECTED_FRAME ())
> (gdb)
> 16877           && redisplay_skip_initial_frame)
> (gdb)
> 16879        return;
> (gdb)
> 
> 
> So, apparently it thinks that my frame is initial.

And for a good reason:

> Some more data about the looks-initial frame:
> 
> (gdb) p *SELECTED_FRAME()
> $102 = {
>   header = {
>     size = 4611686018595348501
>   },
[...]
>   output_data = {
>     tty = 0x0,
>     x = 0x0,
>     w32 = 0x0,
>     ns = 0x0,
>     pgtk = 0x0,
>     haiku = 0x0,
>     android = 0x0
>   },

This zero value exactly means this frame is "initial" it has not yet
been set up as a terminal frame.  That setup happens inside
make-terminal-frame, here:

  f = make_terminal_frame (t);

and make_terminal_frame does

  f->output_method = output_termcap;

Somehow this frame escaped this code, so all kinds of weird things can
happen with it.

> By the way, C-x # isn't enough to close any Emacs frame. If I have
> opened it by running   urxvtcd -e 'emacsclient' '-nw', then later C-x
> # doesn't close it, it just says „No server buffers remain to edit“.
> But C-x C-c does close it.

Use "C-x 5 0" to delete the current frame.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71343; Package emacs. (Fri, 21 Jun 2024 16:34:01 GMT) Full text and rfc822 format available.

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

From: Daniel Clemente <n142857 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: eggert <at> cs.ucla.edu, 71343 <at> debbugs.gnu.org
Subject: Re: bug#71343: 30.0.50; TTY frame doesn't automatically redisplay
 itself after having closed another frame
Date: Fri, 21 Jun 2024 10:47:07 +0000
> Emacs doesn't really talk to the terminal emulator, unless the
> emulator supports known protocols of doing so.  You will see in
> lisp/term/xterm.el that Emacs supports that for xterm that is new
> enough.  Don't know what happens with urxvt, but did you try using
> xterm and saw the same problems?

I tried with xterm and I don't see the same problem. There's more
flickering and slowness but the frame I'm resizing gets redrawn.
I'm using:
xterm -e "emasclient" "-c" &

I just installed other terminals: mlterm, cool-retro-term, Eterm. They
show the problem, just like urxvt. The frame being resized (just after
closing another frame) isn't redrawn.

To simplify testing I'm using
for i in `seq 2`; do mlterm -e "emacsclient" "-c" "-e" '(dired "~")' &
sleep 1; done
and closing the second one and resizing the first one..


I also saw 2 other SIGSEGV with xterm and others, that show possibly
corrupted memory. I reported them as separate bugs but I don't know
whether they're related to this one.

>
> > > > - What if, when resizing the frame (something which Emacs detects),
> > > > Emacs knows/detects that a frame was closed, and decides not to delay
> > > > the redisplay?
> > >
> > > Redisplay of which frame?  Emacs only redisplays a frame if some
> > > change in buffer text justifies that.
> >
> > I propose it should repaint/redisplay the frame whose size changed.
>
> When a frame is resized, it is redisplayed, yes.  But that requires
> Emacs to know that it is resized.
>
> > Don't we know which frame is the one being resized? It should be f in
> > adjust_frame_size. It realizes that e.g. it's being resized from 72 to
> > 61 columns.
>
> I need a backtrace showing the call to adjust_frame_size, of a frame
> that is not redrawn.  I don't think I saw such a backtrace.

In this one, I made a frame less wide (it was around 70 columns, I
made it 60 columns) in the conditions when redraw doesn't happen.

Breakpoint 2, adjust_frame_size (f=0x6210000ede00, new_text_width=60,
    new_text_height=49, inhibit=5, pretend=false, parameter=XIL(0x40e0))
    at frame.c:646
646      int unit_width = FRAME_COLUMN_WIDTH (f);
(gdb) bt
#0  adjust_frame_size (f=0x6210000ede00, new_text_width=60,
    new_text_height=49, inhibit=5, pretend=false, parameter=XIL(0x40e0))
    at frame.c:646
#1  0x00005555564e04c3 in change_frame_size_1 (f=0x6210000ede00,
    new_width=60, new_height=50, pretend=false, delay=false, safe=false)
    at dispnew.c:6054
#2  0x00005555564e0526 in change_frame_size (f=0x6210000ede00,
    new_width=60, new_height=50, pretend=false, delay=false, safe=false)
    at dispnew.c:6087
#3  0x00005555564df618 in do_pending_window_change (safe=false)
    at dispnew.c:6014
#4  0x0000555556e479ee in wait_reading_process_output (time_limit=0,
    nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=XIL(0),
    wait_proc=0x0, just_wait_proc=0) at process.c:5784
#5  0x00005555569b57da in kbd_buffer_get_event (kbp=0x7fffffffca50,
    used_mouse_menu=0x7fffffffd4f0, end_time=0x0) at keyboard.c:4079
#6  0x00005555569a6c45 in read_event_from_main_queue (end_time=0x0,
    local_getcjmp=0x7fffffffd110, used_mouse_menu=0x7fffffffd4f0)
    at keyboard.c:2330
#7  0x00005555569a75b1 in read_decoded_event_from_main_queue (
    end_time=0x0, local_getcjmp=0x7fffffffd110, prev_event=XIL(0),
    used_mouse_menu=0x7fffffffd4f0) at keyboard.c:2394
#8  0x00005555569adaa6 in read_char (commandflag=1,
    map=XIL(0x7fffec72ab93), prev_event=XIL(0),
    used_mouse_menu=0x7fffffffd4f0, end_time=0x0) at keyboard.c:3015
#9  0x00005555569e9ca2 in read_key_sequence (keybuf=0x7fffffffd7e0,
    prompt=XIL(0), dont_downcase_last=false,
    can_return_switch_frame=true, fix_current_buffer=true,
    prevent_redisplay=false, disable_text_conversion_p=false)
    at keyboard.c:10728
--Type <RET> for more, q to quit, c to continue without paging--
#10 0x000055555699b122 in command_loop_1 () at keyboard.c:1429
#11 0x0000555556cbb678 in internal_condition_case (
    bfun=0x55555699a22d <command_loop_1>, handlers=XIL(0x90),
    hfun=0x555556998204 <cmd_error>) at eval.c:1613
#12 0x0000555556999797 in command_loop_2 (handlers=XIL(0x90))
    at keyboard.c:1168
#13 0x0000555556cb84d8 in internal_catch (tag=XIL(0xfb40),
    func=0x555556999767 <command_loop_2>, arg=XIL(0x90)) at eval.c:1292
#14 0x000055555699969a in command_loop () at keyboard.c:1146
#15 0x0000555556996e7a in recursive_edit_1 () at keyboard.c:754
#16 0x0000555556997531 in Frecursive_edit () at keyboard.c:837
#17 0x0000555556989057 in main (argc=3, argv=0x7fffffffdee8)
    at emacs.c:2629
(gdb) bt full
#0  adjust_frame_size (f=0x6210000ede00, new_text_width=60,
    new_text_height=49, inhibit=5, pretend=false, parameter=XIL(0x40e0))
    at frame.c:646
        unit_width = 1458155539
        unit_height = 21845
        old_native_width = 1492352256
        old_native_height = 21845
        new_native_width = 0
        new_native_height = 0
        min_inner_width = -1
        min_inner_height = -1
        r = 0x7ffff4f2b8e4 <mcount+52>
        old_inner_width = -1
        old_inner_height = 32767
        new_inner_width = 0
        new_inner_height = 1718964966
        old_text_cols = 247
        old_text_lines = 0
        new_text_cols = 0
        new_text_lines = 0
        old_text_width = 0
        old_text_height = 0
        inhibit_horizontal = false
        inhibit_vertical = false
        frame = make_fixnum(23456254819227)
#1  0x00005555564e04c3 in change_frame_size_1 (f=0x6210000ede00,
    new_width=60, new_height=50, pretend=false, delay=false, safe=false)
    at dispnew.c:6054
No locals.
#2  0x00005555564e0526 in change_frame_size (f=0x6210000ede00,
--Type <RET> for more, q to quit, c to continue without paging--
    new_width=60, new_height=50, pretend=false, delay=false, safe=false)
    at dispnew.c:6087
        tail = <optimized out>
        frame = <optimized out>
#3  0x00005555564df618 in do_pending_window_change (safe=false)
    at dispnew.c:6014
        f = 0x6210000ede00
        tail = XIL(0x7fffec71a083)
        frame = XIL(0x6210000ede05)
#4  0x0000555556e479ee in wait_reading_process_output (time_limit=0,
[…]



> > (gdb) p *SELECTED_FRAME()
> > $102 = {
> >   header = {
> >     size = 4611686018595348501
> >   },
> [...]
> >   output_data = {
> >     tty = 0x0,
> >     x = 0x0,
> >     w32 = 0x0,
> >     ns = 0x0,
> >     pgtk = 0x0,
> >     haiku = 0x0,
> >     android = 0x0
> >   },
>
> This zero value exactly means this frame is "initial" it has not yet
> been set up as a terminal frame. That setup happens inside
> make-terminal-frame, here:
>
>   f = make_terminal_frame (t);
>
> and make_terminal_frame does
>
>   f->output_method = output_termcap;
>
> Somehow this frame escaped this code, so all kinds of weird things can
> happen with it.

It seems that under normal Emacs operation, the emacs daemon creates
an initial frame which has no output_data->tty.
In addition there are non-initial frames, created by
make_terminal_frame; one for each frame opened by the user.

Could it be that adjust_frame_size is wrongly running on the initial
frame, instead of on the terminal frame?
Mmm… apparently no, it's not that; I just verified it with the
commands below. There's the initial frame (F1) and the visible one
(F5), and f matches F5.

(gdb) list
641     */
642    void
643    adjust_frame_size (struct frame *f, int new_text_width, int
new_text_height,
644               int inhibit, bool pretend, Lisp_Object parameter)
645    {
646      int unit_width = FRAME_COLUMN_WIDTH (f);
647      int unit_height = FRAME_LINE_HEIGHT (f);
648      int old_native_width = FRAME_PIXEL_WIDTH (f);
649      int old_native_height = FRAME_PIXEL_HEIGHT (f);
650      int new_native_width, new_native_height;
(gdb) p f
$34 = (struct frame *) 0x6210000ede00
(gdb) p f->name
$35 = XIL(0x619000159144)
(gdb) xpr
Lisp_String
$36 = (struct Lisp_String *) 0x619000159140
"F5"
(gdb) p Vframe_list
$37 = XIL(0x7fffec71a083)
(gdb) xcons
$38 = (struct Lisp_Cons *) 0x7fffec71a080
{
  u = {
    s = {
      car = XIL(0x6210000ede05),
      u = {
        cdr = XIL(0x7ffff18f00f3),
        chain = 0x7ffff18f00f3
      }
    },
    gcaligned = 0x5
  }
}
(gdb) nextcons
$39 = XIL(0x7ffff18f00f3)
$40 = (struct Lisp_Cons *) 0x7ffff18f00f0
{
  u = {
    s = {
      car = XIL(0x621000003f05),
      u = {
        cdr = XIL(0),
        chain = 0x0
      }
    },
    gcaligned = 0x5
  }
}
(gdb) p 0x6210000ede05
$41 = 107820859973125
(gdb) xpr
Lisp_Vectorlike
PVEC_FRAME
$42 = (struct frame *) 0x6210000ede00
"F5"
No symbol "PVEC_TS_QUERY" in current context.
(gdb) p 0x621000003f05
$43 = 107820859014917
(gdb) xpr
Lisp_Vectorlike
PVEC_FRAME
$44 = (struct frame *) 0x621000003f00
"F1"
No symbol "PVEC_TS_QUERY" in current context.
(gdb)


> > By the way, C-x # isn't enough to close any Emacs frame. If I have
> > opened it by running   urxvtcd -e 'emacsclient' '-nw', then later C-x
> > # doesn't close it, it just says „No server buffers remain to edit“.
> > But C-x C-c does close it.
>
> Use "C-x 5 0" to delete the current frame.

Ok.
The problem reported in this bug report also happens if I use C-x 5 0




This bug report was last modified 158 days ago.

Previous Next


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