2

Say I have beginning-of-line bound to M-a. At least for me, holding shift gives: M-S-a translates to M-A translates to M-a and emacs doesn't do any shift selection.

It's the same when binding keys -- I gotta bind M-A, binding M-S-a doesn't work. Why is this? Is there any way around it?

2
  • Are you using the terminal version of emacs? – Dan Nov 16 '17 at 21:00
  • No that's what's weird. GUI on arch, emacs 25.3.1 – yafov Nov 16 '17 at 21:01
1

The following code works for me:

(bind-key "M-a" (lambda ()
                  "Move point to the first non-whitespace character on this line. If point was already at that position, move point to beginning of line."
                  (interactive "^")
                  (let ((oldpos (point))) (back-to-indentation) (and (= oldpos (point)) (beginning-of-line)))))

Note: "^" is required to support shift selection.

2
0

If option shift-select-mode is nil then shift-selection does not work (it is turned off).

If it is not working for you even with a non-nil value, starting from emacs -Q, then consider filing a bug report: M-x report-emacs-bug.

6
  • so you can bind M-S-a? tried it? – Benjamin Lindqvist Nov 16 '17 at 23:32
  • @BenjaminLindqvist: I don't understand your question. Yes, at least on a graphic display (GUI) you can bind M-S-a (aka M-A). – Drew Nov 17 '17 at 0:03
  • Actually it doesn't seem to be a problem with shift base navigation at all, it is just that certain navigation commands does not respect shift selection. I guess I will open a new question then – yafov Nov 17 '17 at 8:12
  • It works for me, with that navigation command. It should work for you, I think. Again, if it doesn't, consider filing a bug report. – Drew Nov 17 '17 at 16:26
  • So let me ask, does (global-set-key ("M-S-a") ...) work for you? If it does, maybe it's some aliasing thing specific to my keyboard/xmodmap. – Benjamin Lindqvist Nov 17 '17 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.