smartparens icon indicating copy to clipboard operation
smartparens copied to clipboard

Control-Shift-<right>

Open blackspotent opened this issue 9 years ago • 16 comments

Hi, there. I'm new to smartparens. I use C-S- or C-S- alot for selecting "words" It seems like C-S- is not bound to anything but it doesn't work when I enable smartprents-global-strict-mode. How can I bring it back? Thank you very much for the wonderful utility. Cheers! -chris

blackspotent avatar Oct 30 '15 10:10 blackspotent

Any other package which might interfere? SP binds those keys to slurping.

Fuco1 avatar Oct 31 '15 19:10 Fuco1

Without smartparens, "control shift select" works as expected and I don't think there is any conflict.

I bound to C- to sp-forward-slurp-sexp but I didn't bind C-S- to anything.

C-S- does something but M-x describe-key C-S- does not reveal it.

Anyway, is there way to bring the original "control shift select" back? Thanks.

chrisk414 avatar Nov 01 '15 06:11 chrisk414

@chrisk414: What does C-h k C-S-<right> says? is it bound to anything?

Silex avatar Nov 01 '15 14:11 Silex

It is used to select words forward.

chrisk414 avatar Nov 01 '15 14:11 chrisk414

Well, what elisp function is C-S-right bound to? C-h k KEYCOMBO will tell you.

Silex avatar Nov 01 '15 15:11 Silex

This is what it says. <C-S-right> translates to <C-right> and I can't tell what it really bounds to. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<C-right> (translated from <C-S-right>) runs the command right-word (found in global-map), which is an interactive compiled Lisp function in ‘bindings.el’.

It is bound to <C-right>.

(right-word &optional N)

Move point N words to the right (to the left if N is negative).

Depending on the bidirectional context, this may move either forward or backward in the buffer. This is in contrast with M-f and M-b, which see.

Value is normally t. If an edge of the buffer or a field boundary is reached, point is left there there and the function returns nil. Field boundaries are not noticed if ‘inhibit-field-text-motion’ is non-nil.

chrisk414 avatar Nov 01 '15 15:11 chrisk414

<C-right> (translated from <C-S-right>)

Well this is wrong.

Fuco1 avatar Nov 01 '15 16:11 Fuco1

<C-right> (translated from <C-S-right>)

Well this is wrong.

Indeed. Not sure what would trigger it tho, maybe some key modifiers?

Silex avatar Nov 01 '15 17:11 Silex

Am I the only one who has this kind of behavior? <C-S-right> is bound to <C-right> and I would like to keep <C-S-right> as "select-forward-word" as before. This is the only show-stopper using smartparens. Please help. Thanks.

blackspotent avatar Nov 02 '15 10:11 blackspotent

Heh, actually by me I have the same:

<C-right> (translated from <C-S-right>) runs the command right-word
(found in global-map), which is an interactive compiled Lisp function
in ‘bindings.el’.

Except by me it works to select words... so the problem is somewhere else now.

Can you please define what you mean with "it doesn't work"? it doesn't move right? it does but doesn't select?

Silex avatar Nov 02 '15 10:11 Silex

Hi, Silex, That's good to know. I'm using Windows gnu emacs 25.0.50.1

Right now, both behaves the same, i.e., sp-forward-slurp-sexp

With smartparens-mode turned off, <C-S-right> selects word as expected.

blackspotent avatar Nov 02 '15 10:11 blackspotent

Any update on this on using Windows? I'm still having the same problem.

chrisk414 avatar Nov 22 '15 19:11 chrisk414

You can try to unbind C-S-<right> form smartparens-mode-map.

Fuco1 avatar Nov 22 '15 19:11 Fuco1

I tried to unbind the keys as follows after loading smartparent loading hook.

;; undefine keys (define-key smartparens-mode-map (kbd "C-S-") nil) (define-key smartparens-mode-map (kbd "C-S-") nil)

but the behavior is the same.

I think the problem is that it sees C-S- the same as C- in my Windows emacs. But without Smartparent mode enabled, C-S- behaves correctly (selects words) What in Smartparent would affect C-S- behavior?? Please help!!!

Thanks.

blackspotent avatar Dec 29 '15 07:12 blackspotent

Try also setting sp-base-key-bindings to nil. I honestly don't understand what is going on.

Fuco1 avatar Dec 30 '15 10:12 Fuco1

Hi, all! Little bit of digging, I found some more information. I'm using key binding from Fuco where he uses C-/. Once C-/ is bound, C-S-/ will then default to C-/, thus C-S-/ behaves like C-/. I'm not sure if it happens only on Windows though.

chrisk414 avatar Dec 30 '15 12:12 chrisk414