Why does Shift-right says it is bound to right?How to type Org Mode's `M-` bindings in Emacs for Mac?Global Unset Key: BackspaceHow to avoid typing “space” after “^” for moving up in directory in dired?Unset key “C-;” in Aquamacs, bound to toggle-mac-option-modifierWeird keyboard behaviour by Emacs in a terminalChange key for f90-start-abbrevHow to assign TAB to indentation and to yasnippet expand keyOrg-mode completion: remapping `M-TAB`cannot rebind M-pWhy do local-set-key and local-unset-key not work interactively?
Approximating an expression for a potential
Why wasn't interlaced CRT scanning done back and forth?
Went to a big 4 but got fired for underperformance in a year recently - Now every one thinks I'm pro - How to balance expectations?
How does Rust's 128-bit integer `i128` work on a 64-bit system?
Accurately recalling the key - can everyone do it?
Astable 555 circuit not oscillating
Why do my fried eggs start browning very fast?
Does proof-of-work contribute directly to prevent double-spending?
Is the first page of Novel really that important?
How were x-ray diffraction patterns deciphered before computers?
Is an "are" omitted in this sentence
Search and replace a substring only if another substring is not present
What does "autolyco-sentimental" mean?
Why have both: BJT and FET transistors on IC output?
A verb for when some rights are not violated?
How to call made-up data?
On the expression "sun-down"
Subverting the essence of fictional and/or religious entities; is it acceptable?
Is law enforcement responsible for damages made by a search warrant?
What is a summary of basic Jewish metaphysics or theology?
A criterion for finite abelian group to embed into a symmetric group
Lower bound for the number of lattice points on high dimensional spheres
Export economy of Mars
Does a bard know when a character uses their Bardic Inspiration?
Why does Shift-right says it is bound to right?
How to type Org Mode's `M-` bindings in Emacs for Mac?Global Unset Key: BackspaceHow to avoid typing “space” after “^” for moving up in directory in dired?Unset key “C-;” in Aquamacs, bound to toggle-mac-option-modifierWeird keyboard behaviour by Emacs in a terminalChange key for f90-start-abbrevHow to assign TAB to indentation and to yasnippet expand keyOrg-mode completion: remapping `M-TAB`cannot rebind M-pWhy do local-set-key and local-unset-key not work interactively?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I tried to check what function shift-right is bound to which extends the region right by a character by default. But C-h k says:
<right> (translated from <S-right>) runs the command right-char (found
in global-map), which is an interactive compiled Lisp function in
‘bindings.el’.
If S-right does something else than simple right then why does it say it is bound to right?
key-bindings
add a comment |
I tried to check what function shift-right is bound to which extends the region right by a character by default. But C-h k says:
<right> (translated from <S-right>) runs the command right-char (found
in global-map), which is an interactive compiled Lisp function in
‘bindings.el’.
If S-right does something else than simple right then why does it say it is bound to right?
key-bindings
See also stackoverflow.com/a/54591047/324105
– phils
1 hour ago
add a comment |
I tried to check what function shift-right is bound to which extends the region right by a character by default. But C-h k says:
<right> (translated from <S-right>) runs the command right-char (found
in global-map), which is an interactive compiled Lisp function in
‘bindings.el’.
If S-right does something else than simple right then why does it say it is bound to right?
key-bindings
I tried to check what function shift-right is bound to which extends the region right by a character by default. But C-h k says:
<right> (translated from <S-right>) runs the command right-char (found
in global-map), which is an interactive compiled Lisp function in
‘bindings.el’.
If S-right does something else than simple right then why does it say it is bound to right?
key-bindings
key-bindings
asked 8 hours ago
TomTom
3842 silver badges9 bronze badges
3842 silver badges9 bronze badges
See also stackoverflow.com/a/54591047/324105
– phils
1 hour ago
add a comment |
See also stackoverflow.com/a/54591047/324105
– phils
1 hour ago
See also stackoverflow.com/a/54591047/324105
– phils
1 hour ago
See also stackoverflow.com/a/54591047/324105
– phils
1 hour ago
add a comment |
2 Answers
2
active
oldest
votes
Taken from this emacs wiki page:
Emacs is set up so that the keys, particularly all the control-, meta-, alt- keybindings keep working if you inadvertantly leave the shift-lock key on. So it assumes that you were looking for the unshifted one if this is the only keybinding defined on that key. Hence it sees the shifted function key, checks to see if the shifted function key has been bound to a function and if it doesn’t find a keybinding, checks to see if there is anything bound to the unshifted key. If it finds a binding, it gives you that one instead of the one you asked for.
So how to find out what function S-right runs which does something else than simple right?
– Tom
7 hours ago
If there is something bound to it, it will show it. In your case there isn't so it gets translated to right. Execute(global-set-key [(shift f1)] 'info)and check again.
– Hubisan
7 hours ago
But you surely realise that S-right does more, it extends the selection even in default emacs 26.2 with -q. So it's not just for me. So the question is what function in emacs performs the shift detection part in this case?
– Tom
7 hours ago
1
The intereactive code^in theinteractivestatement of a function is what tells Emacs to do something different if theshiftkey is depressed; e.g.,(interactive "^p")used byright-charandleft-char. See the interactive codes section of the Emacs manual for more information: gnu.org/software/emacs/manual/html_node/elisp/… If we were to remove the^from the interactive statement inleft-charand/orright-char, then theshift(if depressed) would have no effect.
– lawlist
7 hours ago
add a comment |
If an input event is not bound and contains the Shift modifier or is an uppercase character, Emacs converts it to the corresponding unshifted or lowercase event. This is discreetly documented in the Emacs Lisp manual under read-key-sequence. Unlike what the docstring of read-key-sequence says, this isn't limited to the first event in a sequence: if KEY1 is bound to a keymap (so it's a prefix key) but S-KEY1 is not bound, pressing S-KEY1 KEY2 results in an event for KEY1 KEY2. However, if S-KEY1 is a prefix key, S-KEY1 KEY2 remains unchanged even if S-KEY1 KEY2 is not bound, regardless of what KEY1 KEY2 might be bound to.
Commands can find out whether such a translation happened by checking the variable this-command-keys-shift-translated. Few commands do. The only ones I can think of are the cursor motion commands that select text when Shift is pressed, like right-char. This mechanism is handled by handle-shift-selection which is triggered for every command that has ^ in its interactive specification.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "583"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f51995%2fwhy-does-shift-right-says-it-is-bound-to-right%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Taken from this emacs wiki page:
Emacs is set up so that the keys, particularly all the control-, meta-, alt- keybindings keep working if you inadvertantly leave the shift-lock key on. So it assumes that you were looking for the unshifted one if this is the only keybinding defined on that key. Hence it sees the shifted function key, checks to see if the shifted function key has been bound to a function and if it doesn’t find a keybinding, checks to see if there is anything bound to the unshifted key. If it finds a binding, it gives you that one instead of the one you asked for.
So how to find out what function S-right runs which does something else than simple right?
– Tom
7 hours ago
If there is something bound to it, it will show it. In your case there isn't so it gets translated to right. Execute(global-set-key [(shift f1)] 'info)and check again.
– Hubisan
7 hours ago
But you surely realise that S-right does more, it extends the selection even in default emacs 26.2 with -q. So it's not just for me. So the question is what function in emacs performs the shift detection part in this case?
– Tom
7 hours ago
1
The intereactive code^in theinteractivestatement of a function is what tells Emacs to do something different if theshiftkey is depressed; e.g.,(interactive "^p")used byright-charandleft-char. See the interactive codes section of the Emacs manual for more information: gnu.org/software/emacs/manual/html_node/elisp/… If we were to remove the^from the interactive statement inleft-charand/orright-char, then theshift(if depressed) would have no effect.
– lawlist
7 hours ago
add a comment |
Taken from this emacs wiki page:
Emacs is set up so that the keys, particularly all the control-, meta-, alt- keybindings keep working if you inadvertantly leave the shift-lock key on. So it assumes that you were looking for the unshifted one if this is the only keybinding defined on that key. Hence it sees the shifted function key, checks to see if the shifted function key has been bound to a function and if it doesn’t find a keybinding, checks to see if there is anything bound to the unshifted key. If it finds a binding, it gives you that one instead of the one you asked for.
So how to find out what function S-right runs which does something else than simple right?
– Tom
7 hours ago
If there is something bound to it, it will show it. In your case there isn't so it gets translated to right. Execute(global-set-key [(shift f1)] 'info)and check again.
– Hubisan
7 hours ago
But you surely realise that S-right does more, it extends the selection even in default emacs 26.2 with -q. So it's not just for me. So the question is what function in emacs performs the shift detection part in this case?
– Tom
7 hours ago
1
The intereactive code^in theinteractivestatement of a function is what tells Emacs to do something different if theshiftkey is depressed; e.g.,(interactive "^p")used byright-charandleft-char. See the interactive codes section of the Emacs manual for more information: gnu.org/software/emacs/manual/html_node/elisp/… If we were to remove the^from the interactive statement inleft-charand/orright-char, then theshift(if depressed) would have no effect.
– lawlist
7 hours ago
add a comment |
Taken from this emacs wiki page:
Emacs is set up so that the keys, particularly all the control-, meta-, alt- keybindings keep working if you inadvertantly leave the shift-lock key on. So it assumes that you were looking for the unshifted one if this is the only keybinding defined on that key. Hence it sees the shifted function key, checks to see if the shifted function key has been bound to a function and if it doesn’t find a keybinding, checks to see if there is anything bound to the unshifted key. If it finds a binding, it gives you that one instead of the one you asked for.
Taken from this emacs wiki page:
Emacs is set up so that the keys, particularly all the control-, meta-, alt- keybindings keep working if you inadvertantly leave the shift-lock key on. So it assumes that you were looking for the unshifted one if this is the only keybinding defined on that key. Hence it sees the shifted function key, checks to see if the shifted function key has been bound to a function and if it doesn’t find a keybinding, checks to see if there is anything bound to the unshifted key. If it finds a binding, it gives you that one instead of the one you asked for.
answered 8 hours ago
HubisanHubisan
4032 silver badges6 bronze badges
4032 silver badges6 bronze badges
So how to find out what function S-right runs which does something else than simple right?
– Tom
7 hours ago
If there is something bound to it, it will show it. In your case there isn't so it gets translated to right. Execute(global-set-key [(shift f1)] 'info)and check again.
– Hubisan
7 hours ago
But you surely realise that S-right does more, it extends the selection even in default emacs 26.2 with -q. So it's not just for me. So the question is what function in emacs performs the shift detection part in this case?
– Tom
7 hours ago
1
The intereactive code^in theinteractivestatement of a function is what tells Emacs to do something different if theshiftkey is depressed; e.g.,(interactive "^p")used byright-charandleft-char. See the interactive codes section of the Emacs manual for more information: gnu.org/software/emacs/manual/html_node/elisp/… If we were to remove the^from the interactive statement inleft-charand/orright-char, then theshift(if depressed) would have no effect.
– lawlist
7 hours ago
add a comment |
So how to find out what function S-right runs which does something else than simple right?
– Tom
7 hours ago
If there is something bound to it, it will show it. In your case there isn't so it gets translated to right. Execute(global-set-key [(shift f1)] 'info)and check again.
– Hubisan
7 hours ago
But you surely realise that S-right does more, it extends the selection even in default emacs 26.2 with -q. So it's not just for me. So the question is what function in emacs performs the shift detection part in this case?
– Tom
7 hours ago
1
The intereactive code^in theinteractivestatement of a function is what tells Emacs to do something different if theshiftkey is depressed; e.g.,(interactive "^p")used byright-charandleft-char. See the interactive codes section of the Emacs manual for more information: gnu.org/software/emacs/manual/html_node/elisp/… If we were to remove the^from the interactive statement inleft-charand/orright-char, then theshift(if depressed) would have no effect.
– lawlist
7 hours ago
So how to find out what function S-right runs which does something else than simple right?
– Tom
7 hours ago
So how to find out what function S-right runs which does something else than simple right?
– Tom
7 hours ago
If there is something bound to it, it will show it. In your case there isn't so it gets translated to right. Execute
(global-set-key [(shift f1)] 'info) and check again.– Hubisan
7 hours ago
If there is something bound to it, it will show it. In your case there isn't so it gets translated to right. Execute
(global-set-key [(shift f1)] 'info) and check again.– Hubisan
7 hours ago
But you surely realise that S-right does more, it extends the selection even in default emacs 26.2 with -q. So it's not just for me. So the question is what function in emacs performs the shift detection part in this case?
– Tom
7 hours ago
But you surely realise that S-right does more, it extends the selection even in default emacs 26.2 with -q. So it's not just for me. So the question is what function in emacs performs the shift detection part in this case?
– Tom
7 hours ago
1
1
The intereactive code
^ in the interactive statement of a function is what tells Emacs to do something different if the shift key is depressed; e.g., (interactive "^p") used by right-char and left-char. See the interactive codes section of the Emacs manual for more information: gnu.org/software/emacs/manual/html_node/elisp/… If we were to remove the ^ from the interactive statement in left-char and/or right-char, then the shift (if depressed) would have no effect.– lawlist
7 hours ago
The intereactive code
^ in the interactive statement of a function is what tells Emacs to do something different if the shift key is depressed; e.g., (interactive "^p") used by right-char and left-char. See the interactive codes section of the Emacs manual for more information: gnu.org/software/emacs/manual/html_node/elisp/… If we were to remove the ^ from the interactive statement in left-char and/or right-char, then the shift (if depressed) would have no effect.– lawlist
7 hours ago
add a comment |
If an input event is not bound and contains the Shift modifier or is an uppercase character, Emacs converts it to the corresponding unshifted or lowercase event. This is discreetly documented in the Emacs Lisp manual under read-key-sequence. Unlike what the docstring of read-key-sequence says, this isn't limited to the first event in a sequence: if KEY1 is bound to a keymap (so it's a prefix key) but S-KEY1 is not bound, pressing S-KEY1 KEY2 results in an event for KEY1 KEY2. However, if S-KEY1 is a prefix key, S-KEY1 KEY2 remains unchanged even if S-KEY1 KEY2 is not bound, regardless of what KEY1 KEY2 might be bound to.
Commands can find out whether such a translation happened by checking the variable this-command-keys-shift-translated. Few commands do. The only ones I can think of are the cursor motion commands that select text when Shift is pressed, like right-char. This mechanism is handled by handle-shift-selection which is triggered for every command that has ^ in its interactive specification.
add a comment |
If an input event is not bound and contains the Shift modifier or is an uppercase character, Emacs converts it to the corresponding unshifted or lowercase event. This is discreetly documented in the Emacs Lisp manual under read-key-sequence. Unlike what the docstring of read-key-sequence says, this isn't limited to the first event in a sequence: if KEY1 is bound to a keymap (so it's a prefix key) but S-KEY1 is not bound, pressing S-KEY1 KEY2 results in an event for KEY1 KEY2. However, if S-KEY1 is a prefix key, S-KEY1 KEY2 remains unchanged even if S-KEY1 KEY2 is not bound, regardless of what KEY1 KEY2 might be bound to.
Commands can find out whether such a translation happened by checking the variable this-command-keys-shift-translated. Few commands do. The only ones I can think of are the cursor motion commands that select text when Shift is pressed, like right-char. This mechanism is handled by handle-shift-selection which is triggered for every command that has ^ in its interactive specification.
add a comment |
If an input event is not bound and contains the Shift modifier or is an uppercase character, Emacs converts it to the corresponding unshifted or lowercase event. This is discreetly documented in the Emacs Lisp manual under read-key-sequence. Unlike what the docstring of read-key-sequence says, this isn't limited to the first event in a sequence: if KEY1 is bound to a keymap (so it's a prefix key) but S-KEY1 is not bound, pressing S-KEY1 KEY2 results in an event for KEY1 KEY2. However, if S-KEY1 is a prefix key, S-KEY1 KEY2 remains unchanged even if S-KEY1 KEY2 is not bound, regardless of what KEY1 KEY2 might be bound to.
Commands can find out whether such a translation happened by checking the variable this-command-keys-shift-translated. Few commands do. The only ones I can think of are the cursor motion commands that select text when Shift is pressed, like right-char. This mechanism is handled by handle-shift-selection which is triggered for every command that has ^ in its interactive specification.
If an input event is not bound and contains the Shift modifier or is an uppercase character, Emacs converts it to the corresponding unshifted or lowercase event. This is discreetly documented in the Emacs Lisp manual under read-key-sequence. Unlike what the docstring of read-key-sequence says, this isn't limited to the first event in a sequence: if KEY1 is bound to a keymap (so it's a prefix key) but S-KEY1 is not bound, pressing S-KEY1 KEY2 results in an event for KEY1 KEY2. However, if S-KEY1 is a prefix key, S-KEY1 KEY2 remains unchanged even if S-KEY1 KEY2 is not bound, regardless of what KEY1 KEY2 might be bound to.
Commands can find out whether such a translation happened by checking the variable this-command-keys-shift-translated. Few commands do. The only ones I can think of are the cursor motion commands that select text when Shift is pressed, like right-char. This mechanism is handled by handle-shift-selection which is triggered for every command that has ^ in its interactive specification.
answered 1 hour ago
Gilles♦Gilles
14.1k4 gold badges37 silver badges76 bronze badges
14.1k4 gold badges37 silver badges76 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Emacs Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f51995%2fwhy-does-shift-right-says-it-is-bound-to-right%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
See also stackoverflow.com/a/54591047/324105
– phils
1 hour ago