I am not certain, but my intuition is that the issue should be fixed somewhere around here. An alternative could be to set the arrow position not when receiving a message, but when the chat buffer is not being displayed anymore. One edge case I foresee is to handle the situation when no new messages were received, and the buffer was just selected manually. > In GNU Emacs 29.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6) > of 2022-04-09 built on T480s > Repository revision: 8b3748c234e8be8c2b34c263cb216fef5a5f2279 > Repository branch: master > System Description: Arch Linux > > Configured using: > 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib > --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games > --with-sound=alsa --with-modules --without-libotf --without-m17n-flt > --without-gconf --without-gsettings --with-native-compilation > --with-xinput2 --with-pgtk --without-xaw3d --with-sound=no > --without-gpm --without-compress-install > '--program-transform-name=s/\([ec]tags\)/\1.emacs/' > 'CFLAGS=-march=native -O2 -pipe -fno-plt -fexceptions > -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security > -fstack-clash-protection -fcf-protection -g > -ffile-prefix-map=/home/davide/src/emacs-git/src=/usr/src/debug' > LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' > > Configured features: > ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 > LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG > RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XIM GTK3 ZLIB > > Important settings: > value of $LC_MONETARY: it_IT.UTF-8 > value of $LANG: en_GB.UTF-8 > locale-coding-system: utf-8-unix > > Major mode: Lisp Interaction > > Minor modes in effect: > global-git-commit-mode: t > magit-auto-revert-mode: t > shell-dirtrack-mode: t > rcirc-track-minor-mode: t > global-tree-sitter-mode: t > dired-hist-mode: t > electric-pair-mode: t > recentf-mode: t > save-place-mode: t > global-diff-hl-mode: t > yas-global-mode: t > yas-minor-mode: t > which-key-mode: t > global-auto-revert-mode: t > repeat-mode: t > pixel-scroll-precision-mode: t > undo-hl-mode: t > display-line-numbers-mode: t > display-fill-column-indicator-mode: t > flymake-mode: t > rainbow-delimiters-mode: t > highlight-parentheses-mode: t > corfu-global-mode: t > corfu-mode: t > marginalia-mode: t > savehist-mode: t > vertico-mouse-mode: t > vertico-mode: t > minibuffer-depth-indicate-mode: t > global-so-long-mode: t > override-global-mode: t > tooltip-mode: t > global-eldoc-mode: t > eldoc-mode: t > show-paren-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > tab-bar-mode: t > file-name-shadow-mode: t > context-menu-mode: t > global-font-lock-mode: t > font-lock-mode: t > size-indication-mode: t > column-number-mode: t > line-number-mode: t > transient-mark-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > > Load-path shadows: > ~/src/undo-hl/undo-hl hides /home/davide/.emacs.d/elpa/undo-hl-1.0/undo-hl > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-draft hides /usr/share/emacs/site-lisp/notmuch-draft > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-compat hides /usr/share/emacs/site-lisp/notmuch-compat > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-jump hides /usr/share/emacs/site-lisp/notmuch-jump > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-mua hides /usr/share/emacs/site-lisp/notmuch-mua > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-message hides /usr/share/emacs/site-lisp/notmuch-message > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-tag hides /usr/share/emacs/site-lisp/notmuch-tag > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-query hides /usr/share/emacs/site-lisp/notmuch-query > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-print hides /usr/share/emacs/site-lisp/notmuch-print > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-maildir-fcc hides /usr/share/emacs/site-lisp/notmuch-maildir-fcc > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-address hides /usr/share/emacs/site-lisp/notmuch-address > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-parser hides /usr/share/emacs/site-lisp/notmuch-parser > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-show hides /usr/share/emacs/site-lisp/notmuch-show > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-wash hides /usr/share/emacs/site-lisp/notmuch-wash > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-hello hides /usr/share/emacs/site-lisp/notmuch-hello > /home/davide/.emacs.d/elpa/notmuch-0.35/coolj hides /usr/share/emacs/site-lisp/coolj > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-lib hides /usr/share/emacs/site-lisp/notmuch-lib > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-tree hides /usr/share/emacs/site-lisp/notmuch-tree > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch hides /usr/share/emacs/site-lisp/notmuch > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-company hides /usr/share/emacs/site-lisp/notmuch-company > /home/davide/.emacs.d/elpa/notmuch-0.35/notmuch-crypto hides /usr/share/emacs/site-lisp/notmuch-crypto > /home/davide/.emacs.d/elpa/transient-20220406.1156/transient hides /usr/share/emacs/29.0.50/lisp/transient > > Features: > (shadow sort company-oddmuse company-keywords company-etags > company-gtags company-dabbrev-code company-dabbrev company-files > company-clang company-capf company-cmake company-semantic > company-template company-bbdb mail-extr emacsbug 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 org-refile > ox-html table ox-ascii ox-publish ox scroll-lock expand-region > text-mode-expansions cc-mode-expansions the-org-mode-expansions > python-el-fgallina-expansions er-basic-expansions expand-region-core > expand-region-custom rainbow-mode xterm-color conf-mode flymake-cc > consult-icomplete icomplete diff-hl-dired matlab-cgen tempo > consult-imenu tabify man cus-edit cus-start cus-load etags fileloop > notmuch notmuch-tree notmuch-jump notmuch-hello notmuch-show > notmuch-print notmuch-crypto notmuch-mua notmuch-message notmuch-draft > notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser > notmuch-wash coolj notmuch-query icalendar diary-lib diary-loaddefs > notmuch-tag notmuch-lib notmuch-version notmuch-compat debug > consult-xref grep xref cl-print timer-list novice helpful trace edebug > backtrace info-look f elisp-refs help-fns misearch multi-isearch ibuffer > ibuffer-loaddefs goto-addr bug-reference autoload radix-tree mm-archive > face-remap magit-extras magit-bookmark 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 git-commit log-edit add-log magit-core magit-autorevert > magit-margin magit-transient magit-process with-editor magit-mode > transient magit-git magit-base magit-section crm url-http url-gw > url-cache url-auth hl-line cdlatex texmathp org-indent image-file > image-converter org-element ol-eww eww xdg mm-url ol-rmail ol-mhe ol-irc > ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime > dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud > nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range > gnus-win gnus nnheader range ol-docview doc-view jka-compr image-mode > exif ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi org-mouse elfeed-org s > dash ob-shell shell ob-python python ob-gnuplot ob-ditaa ob-C cc-mode > cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars > cc-defs org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro > org-footnote org-src ob-comint org-pcomplete pcomplete org-list > org-faces org-entities noutline outline org-version ob-emacs-lisp > ob-core ob-eval org-table oc-basic bibtex ol org-keys oc org-compat > advice org-macs org-loaddefs format-spec find-func cal-menu calendar > cal-loaddefs elfeed-show elfeed-search message sendmail yank-media > rfc822 mml mml-sec gnus-util mm-decode mm-bodies mm-encode mail-parse > rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev > mail-utils gmm-utils mailheader shr pixel-fill kinsoku svg dom > elfeed-csv elfeed elfeed-curl elfeed-log elfeed-db elfeed-lib avl-tree > generator url-queue url-file url-dired xml-query xml rcirc-menu > hippie-exp company-yasnippet vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-svn > vc-cvs vc-rcs vc-git matlab matlab-scan matlab-syntax matlab-compat > embark-consult consult-vertico consult disp-table gnutls network-stream > puny nsm rmc rcirc-color rcirc epa-file epa derived epg rfc6068 > epg-config parse-time iso8601 vertico-directory char-fold mule-util > cursor-sensor vertico-repeat tree-sitter-langs tree-sitter-langs-build > tar-mode arc-mode archive-mode tree-sitter-hl tree-sitter > tree-sitter-load tree-sitter-cli tsc tsc-dyn tsc-dyn-get dired-aux > dired-hist dired-x dired dired-loaddefs tsc-obsolete elec-pair embark > ffap ace-link avy recentf tree-widget wid-edit saveplace-pdf-view > bookmark pp saveplace company auth-source-pass diff-hl log-view > pcvs-util vc-dir ewoc vc vc-dispatcher diff-mode yasnippet-snippets > yasnippet which-key autorevert filenotify repeat pixel-scroll cua-base > undo-hl pulse color iedit iedit-lib server display-line-numbers > display-fill-column-indicator time-date checkdoc lisp-mnt flymake-proc > flymake project compile text-property-search comint ansi-color ring > thingatpt rainbow-delimiters highlight-parentheses delight finder-inf > cape corfu marginalia savehist orderless vertico-mouse vertico edmacro > kmacro modus-vivendi-theme modus-operandi-theme modus-themes > no-littering comp comp-cstr warnings rx cl-extra help-mode mb-depth > so-long use-package use-package-ensure use-package-delight > use-package-diminish use-package-bind-key bind-key easy-mmode > use-package-core tex-site info package browse-url url url-proxy > url-privacy url-expand url-methods url-history url-cookie url-domsuf > url-util mailcap url-handlers url-parse auth-source cl-seq eieio > eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq > gv subr-x byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib pcase > iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks > lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win > tool-bar dnd fontset image regexp-opt fringe tabulated-list replace > newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar > rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock > font-lock syntax font-core term/tty-colors frame minibuffer nadvice > simple 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 > emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help > abbrev obarray oclosure cl-preloaded button 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 dbusbind inotify dynamic-setting font-render-setting cairo gtk > pgtk lcms2 multi-tty make-network-process native-compile emacs) > > Memory information: > ((conses 16 2989949 527679) > (symbols 48 58328 5) > (strings 32 529101 94588) > (string-bytes 1 32670177) > (vectors 16 151986) > (vector-slots 8 3099296 315632) > (floats 8 4276 12424) > (intervals 56 283208 88) > (buffers 992 81)) > > > > -- Philip Kaludercic