GNU bug report logs - #19513
shift-select-mode fails to be fully buffer-local

Previous Next

Package: emacs;

Reported by: Kelly Dean <kelly <at> prtime.org>

Date: Mon, 5 Jan 2015 01:08:02 UTC

Severity: minor

Fixed in version 25.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kelly Dean <kelly <at> prtime.org>
To: 19513 <at> debbugs.gnu.org
Subject: bug#19513: shift-select-mode fails to be fully buffer-local
Date: Mon, 05 Jan 2015 01:06:04 +0000
With Emacs 24.4, do emacs -Q, get two windows in your frame, and different buffers in the windows, and some text in each buffer.
In one of them, (setq-local shift-select-mode nil).
In each of them, try shifted motion followed by non-shifted motion, and you get the expected result. That indicates that shift-select-mode is buffer-local.
You trigger the bug like this:
Switch to the window with the buffer with shift-select-mode on. Do shifted motion, but not non-shifted, so the selection remains.
C-x o
Do any motion (shifted or non-shifted), and you get the expected result (no selection).
C-x o
Do non-shifted motion, which is supposed to turn off the selection. However, the selection remains.

I know you'll consider it weird to want to buffer-locally disable shift-select-mode. But the mode is enabled and disabled by setting a variable, Emacs supports buffer-local variables (which aren't supposed to affect other buffers), and I don't see anything in the docs that says the shift-select-mode variable is an exception to buffer-locality. So the above behavior is a bug.

The reason I want to do that is I have a minor mode that depends on shift-select-mode being disabled. I never use shift-select-mode myself, so I always have it disabled, but I'm trying to enhance my mode so it will work for everybody else. I could simply disable shift-select-mode globally while my mode is enabled (and restore the former setting when my mode is disabled), but that would affect all buffers, not just the buffer in which my mode is enabled. The right way to do it is to buffer-locally disable shift-select-mode, but the bug above prevents that.

The easy solution is to remove shift-select-mode from Emacs. That's what I vote for, but I guess I'm in the minority. ;-)




This bug report was last modified 8 years and 97 days ago.

Previous Next


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