GNU bug report logs - #59943
30.0.50; ERC 5.5+: Add visual indicator to ERC keep-place

Previous Next

Package: emacs;

Reported by: "J.P." <jp <at> neverwas.me>

Date: Sat, 10 Dec 2022 15:53:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Fixed in version 30.1

Done: "J.P." <jp <at> neverwas.me>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59943 in the body.
You can then email your comments to 59943 AT debbugs.gnu.org in the normal way.

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

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


Report forwarded to emacs-erc <at> gnu.org, bug-gnu-emacs <at> gnu.org:
bug#59943; Package emacs. (Sat, 10 Dec 2022 15:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "J.P." <jp <at> neverwas.me>:
New bug report received and forwarded. Copy sent to emacs-erc <at> gnu.org, bug-gnu-emacs <at> gnu.org. (Sat, 10 Dec 2022 15:53:02 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; ERC 5.5+: Add visual indicator to ERC keep-place
Date: Sat, 10 Dec 2022 07:52:14 -0800
[Message part 1 (text/plain, inline)]
Tags: patch

Hi people,

There's been some recent talk regarding ERC's lack of a visual element
to demarcate the boundary between seen and unseen messages in a target
buffer. This approach leverages the existing `keep-place' module located
in erc-goodies. (But perhaps there's a smarter way?) Improvements or
replacements welcome, as always.

Thanks,
J.P.


In GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2022-12-10 built on localhost
Repository revision: 9c670695b91deb3424a74cd2b0f6a37356a4efcc
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 36 (Workstation Edition)

Configured using:
 'configure --enable-check-lisp-object-type --enable-checking=yes,glyphs
 'CFLAGS=-O0 -g3'
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

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

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils erc iso8601 time-date
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map thingatpt pp format-spec cl-loaddefs cl-lib erc-backend erc-goodies
erc-networks byte-opt gv bytecomp byte-compile erc-common erc-compat
erc-loaddefs rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd 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 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 dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process emacs)

Memory information:
((conses 16 64369 5963)
 (symbols 48 8607 0)
 (strings 32 23642 2119)
 (string-bytes 1 684025)
 (vectors 16 15217)
 (vector-slots 8 208839 8628)
 (floats 8 24 27)
 (intervals 56 227 0)
 (buffers 984 11))

[0001-Add-option-to-show-visual-erc-keep-place-indicator.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59943; Package emacs. (Fri, 16 Dec 2022 14:27:01 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 59943 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#59943: 30.0.50; ERC 5.5+: Add visual indicator to ERC
 keep-place
Date: Fri, 16 Dec 2022 06:26:31 -0800
[Message part 1 (text/plain, inline)]
v2. Show indicator in server buffers (kind of annoying IMO). Don't
update indicator when buffer appears in active frame.

[0000-v1-v2.diff (text/x-patch, attachment)]
[0001-Add-option-to-show-visual-erc-keep-place-indicator.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59943; Package emacs. (Wed, 01 Feb 2023 02:50:01 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 59943 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#59943: 30.0.50; ERC 5.5+: Add visual indicator to ERC
 keep-place
Date: Tue, 31 Jan 2023 18:49:16 -0800
"J.P." <jp <at> neverwas.me> writes:

> v2. Show indicator in server buffers (kind of annoying IMO). Don't
> update indicator when buffer appears in active frame.

Just noticed there's a forward declaration missing for `fringe-column'
atop goodies. The ones for ERC's own libraries can be removed whenever
bug#60954 happens because it'll have us requiring `erc' anyhow (not
present in latest "v3" change set).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59943; Package emacs. (Mon, 20 Feb 2023 15:34:01 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 59943 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#59943: 30.0.50; ERC 5.5+: Add visual indicator to ERC
 keep-place
Date: Mon, 20 Feb 2023 07:33:22 -0800
[Message part 1 (text/plain, inline)]
v3. Convert to local module. Add option to discriminate on buffer type.

(This is meant to be applied atop bug#60954. The attached version has
been modified to apply cleanly on HEAD but is untested as such. See
https://emacs-erc.gitlab.io/bugs/49860/patches.tar.gz for the combined
set in its natural order.)

[0000-v2-v3.diff (text/x-patch, attachment)]
[0001-5.6-Add-option-to-show-visual-erc-keep-place-indicat.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59943; Package emacs. (Thu, 09 Mar 2023 14:42:01 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 59943 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#59943: 30.0.50; ERC 5.5+: Add visual indicator to ERC
 keep-place
Date: Thu, 09 Mar 2023 06:41:30 -0800
[Message part 1 (text/plain, inline)]
v4. Push mark before moving in go-to command.

[0000-v3-v4.diff (text/x-patch, attachment)]
[0001-5.6-Add-option-to-show-visual-erc-keep-place-indicat.patch (text/x-patch, attachment)]

bug marked as fixed in version 30.1, send any further explanations to 59943 <at> debbugs.gnu.org and "J.P." <jp <at> neverwas.me> Request was from "J.P." <jp <at> neverwas.me> to control <at> debbugs.gnu.org. (Sat, 08 Apr 2023 22:56:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 May 2023 11:24:06 GMT) Full text and rfc822 format available.

bug unarchived. Request was from "J.P." <jp <at> neverwas.me> to control <at> debbugs.gnu.org. (Fri, 14 Jul 2023 00:20:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59943; Package emacs. (Fri, 14 Jul 2023 02:04:01 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 59943 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#59943: 30.0.50; ERC 5.5+: Add visual indicator to ERC
 keep-place
Date: Thu, 13 Jul 2023 19:03:07 -0700
Reflecting back, I think the decision to tether this local module to the
global module `keep-place' was wrong. A likely usage pattern for this
feature is per-buffer activation, whether interactively or via join
hook. Such users shouldn't be asked to buy into `keep-place' everywhere.
Contrast this with `fill-wrap'. It too is a local module that depends on
a global one, but there's no clear use case for *not* wanting it in some
subset of buffers, so it's effectively global (but technically local for
maintenance reasons).

Anyway, I've gone ahead and fixed this problem [1], so that `keep-place'
and `keep-place-indicator' are completely separate but work in tandem
when `keep-place' is active. However, as implied, the local module can
also operate completely independently.

Thanks.

P.S. Don't be confused by the version in the subject line: the original
`keep-place' is new in ERC 5.6.

[1] https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=2716dd13




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 11 Aug 2023 11:24:09 GMT) Full text and rfc822 format available.

bug unarchived. Request was from "J.P." <jp <at> neverwas.me> to control <at> debbugs.gnu.org. (Tue, 02 Jan 2024 03:30:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59943; Package emacs. (Tue, 02 Jan 2024 14:48:02 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 59943 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#59943: 30.0.50; ERC 5.5+: Add visual indicator to ERC
 keep-place
Date: Tue, 02 Jan 2024 06:47:39 -0800
[Message part 1 (text/plain, inline)]
From emacs -Q

  1. M-: (setopt erc-keep-place-indicator-follow t) RET
     M-x erc RET ... RET

  2. In the server buffer, do M-x erc-keep-place-indicator-mode RET

  3. Scroll "up" to hide the indicator but not so far that point moves
     beyond `erc-insert-marker'

  4. Switch away to another buffer and then back

  5. Notice the indicator fails to update

This happens because `keep-place-indicator' is a local module, and it
adds `erc--keep-place-indicator-on-window-buffer-change' to the hook
`window-buffer-change-functions' locally. But that function needs to run
in the buffer that's being switched to, which may not have the mode
enabled (and thus not have the hook member available). Subscribing to
the hook globally should fix the problem. There are also at least two
bugs affecting the integration between `keep-place-indicator' and
`keep-place'. The attached patch attempts to address these as well.

[0001-5.6-Make-erc-send-input-lines-a-normal-function.patch (text/x-patch, attachment)]
[0002-5.6-Use-global-window-hook-for-erc-keep-place-indica.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59943; Package emacs. (Mon, 08 Jan 2024 05:48:01 GMT) Full text and rfc822 format available.

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

From: "J.P." <jp <at> neverwas.me>
To: 59943 <at> debbugs.gnu.org
Cc: emacs-erc <at> gnu.org
Subject: Re: bug#59943: 30.0.50; ERC 5.5+: Add visual indicator to ERC
 keep-place
Date: Sun, 07 Jan 2024 21:47:39 -0800
"J.P." <jp <at> neverwas.me> writes:

>>From emacs -Q
>
>   1. M-: (setopt erc-keep-place-indicator-follow t) RET
>      M-x erc RET ... RET
>
>   2. In the server buffer, do M-x erc-keep-place-indicator-mode RET
>
>   3. Scroll "up" to hide the indicator but not so far that point moves
>      beyond `erc-insert-marker'
>
>   4. Switch away to another buffer and then back
>
>   5. Notice the indicator fails to update
>
> This happens because `keep-place-indicator' is a local module, and it
> adds `erc--keep-place-indicator-on-window-buffer-change' to the hook
> `window-buffer-change-functions' locally. But that function needs to run
> in the buffer that's being switched to, which may not have the mode
> enabled (and thus not have the hook member available). Subscribing to
> the hook globally should fix the problem. There are also at least two
> bugs affecting the integration between `keep-place-indicator' and
> `keep-place'. The attached patch attempts to address these as well.

This has been installed as:

  fad2d1e2acc * Use global window hook for erc-keep-place-indicator

This bug is already closed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 05 Feb 2024 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 79 days ago.

Previous Next


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