bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29111: 26.0.90; Erc keep-place module broken with new default of swi


From: martin rudalics
Subject: bug#29111: 26.0.90; Erc keep-place module broken with new default of switch-to-buffer-preserve-window-point
Date: Fri, 03 Nov 2017 08:58:48 +0100

> I tried this, and it seems to restore keep-place functionality when
> switching to buffers with M-x erc-track-switch-buffer, but not with C-x
> b. I suspect the call to switch-to-buffer in C-x b isn't handled by erc,
> so changing the function won't help. Obviously, I don't think that's an
> acceptable solution.

"keep place" means "preserve point" so it's somewhat surprising that
this is a problem in the first place.  Can you explain why and how the
keep place mechanism and the ‘switch-to-buffer-preserve-window-point’
mechanisms differ?  Is ‘window-point-insertion-type’ involved somehow?

> I can think of two solutions right now:
>
> 1. Add a new configuration option which allows keep-place mode to
> disable this setting dynamically, and on enabling keep-place, add erc
> buffers to the exempted list. I took a look at `switch-to-buffer' and I
> don't see any way this can be done without a new variable. I personally
> would like to use the new default for non-erc buffers, and I would
> suspect that others would like to turn it on selectively as well.

Alternatively, we could allow ‘switch-to-buffer-preserve-window-point’
have a buffer local value which would override the customizable value
and add a new value, say 'always', which would allow the user to
override a local 'nil' while the default 't' would have the local 'nil'
prevail.  Maybe we'd then need a 'never' too ...

> 2. Make it impossible to miss that this variable must be turned off when
> keep-place is enabled. If this isn't done, people's config will silently
> break (which is pretty bad). I would think that keep-place should throw
> an error when this variable is t, to be safe (since it doesn't work at
> all when it is).
>
> What do you think? I would be happy if keep-place would work out of the
> box for new users of erc, but I'm not sure if that's possible...

Since ‘keep-place’ is some sort of a minor mode, enabling it should warn
the user about the ‘switch-to-buffer-preserve-window-point’
incompatibility.  But I'm not familiar with ‘define-erc-module’ so we'd
probably need someone knowledgeable to do that.

martin






reply via email to

[Prev in Thread] Current Thread [Next in Thread]