unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Javier <nospam@nospam.com>
To: help-gnu-emacs@gnu.org
Subject: Re: shift+left/right arrow cannot be bound in Emacs
Date: Mon, 14 Sep 2015 21:52:06 +0000 (UTC)	[thread overview]
Message-ID: <mt7fi6$3ab$1@speranza.aioe.org> (raw)
In-Reply-To: mailman.1119.1442251609.19560.help-gnu-emacs@gnu.org

>> In my Emacs 25.0.50.1 on Kubuntu 15.04 asking for the current binding
>> with C-h k shift+left shows
> 
>> <left> (translated from <S-left>) runs the command left-char (found in
>> ...
> 
> The same, I think I begin to understand, the reason is that shift+arrows
> is used for setting the mark (as in MS windows) so it might not be
> possible to bind these key combination.

I can bind them without problem

;;; Deactivate Shift+Arrow To Select Text
(setq shift-select-mode nil)
(global-set-key [S-left] 'my-function)
(global-set-key [S-right] 'my-function)

You can try to type S-left and use C-h l (view lossage) to check what key presses emacs detects.

Are you using emacs -nw in a terminal?  For xterm I use
;; XTERM THROUGH SSH
(define-key function-key-map "\e[1;2A" '[S-up])
(define-key function-key-map "\e[1;2B" '[S-down])
(define-key function-key-map "\e[1;2C" '[S-right])
(define-key function-key-map "\e[1;2D" '[S-left])


Are you using org-mode? shift+arrow have a different meaning in
org-mode that clashes with emacs defaults.

;;; Avoid redefining of keys by org-mode
(defun org-mode-keys ()
  "Keybindings for org-mode.  To be used as a hook."
  (local-set-key [S-left] 'my-function)
  (local-set-key [S-right] 'my-function)
  )
(add-hook 'org-mode-hook 'org-mode-keys)
            


  parent reply	other threads:[~2015-09-14 21:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14 15:29 shift+left/right arrow cannot be bound in Emacs Uwe Brauer
2015-09-14 15:35 ` Kaushal Modi
2015-09-14 16:48 ` Óscar Fuentes
2015-09-14 17:26   ` Uwe Brauer
     [not found]   ` <mailman.1119.1442251609.19560.help-gnu-emacs@gnu.org>
2015-09-14 18:55     ` Dan Espen
2015-09-14 19:47     ` B. T. Raven
2015-09-14 21:52     ` Javier [this message]
2015-09-15 23:40 ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='mt7fi6$3ab$1@speranza.aioe.org' \
    --to=nospam@nospam.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).