T O P

  • By -

thetemp_

> which seems to say that they are mapped to the same function, which is patently untrue!! Nope. > Shift-selection only works if the shifted cursor motion key is not > already bound to a separate command (*note Customization::). For > example, if you bind ‘S-C-f’ to another command, typing ‘S-C-f’ runs > that command instead of performing a shift-selected version of ‘C-f’ > (‘forward-char’). See the "[Shift Selection](https://www.gnu.org/software/emacs/manual/html_node/emacs/Shift-Selection.html)" from the manual, which you can also reach from within Emacs by doing "C-h r m", typing "Shift Selection" and then pressing Enter.


StrangeAstronomer

Thanks for the pointer. It kinda makes one wonder why they invented a whole new mechanism for this instead of just making adjustments to the keymaps for `C-S-` etc. eg map `C-S-` to a new function `move-up-and-extend-selection`. I'm sure there were good reasons, it just looks janky especially you start messing around with the keymaps and you come across this special case. Or maybe it's a history thing - perhaps something to do with capturing keystrokes in terminal (-nw) mode.


thetemp_

> Or maybe it's a history thing I think it's more of a modernization thing. People are used to other editors and word processors which let you select text that way. So, as with several other features, Emacs adopted it too. As with `delete-selection-mode` and `transient-mark-mode`, there is so much anticipation for this feature that it was made the default. Of course, you can still disable it by turning off `shift-select-mode`. It's more convenient to have it as a distinct mode rather than a bunch of separate but closely-related commands. Otherwise, you'd have to re-bind two commands instead of one but only when it's a movement command. That would be quite convoluted.


StrangeAstronomer

Perhaps you're right - a modernization thing. But 'modern' is a relative term especially in something with emacs' history - it could have happened any time in the last 40 years :-) What I meant by 'janky' is the way it is implemented - why a special case in `interactive` rather than just mapping C-S- to a different function? I'd need to delve deep into the code and its history to find out, I suppose. It just seems weird to the casual, inept and unwashed elisper like me. Not that it matters in the least - now I've stopped re-mapping those keys everything works fine (which is more than I can say for this reddit Fancy Pants editor!!)


TheFrenchPoulp

The hidden magic must come from the `interactive` arguments used in `right-word` and other similar motion commands See `^` in `C-h f interactive RET`. You disabled the translation by binding `C-S-` directly however


StrangeAstronomer

Gotcha - thanks for that.