From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Javier Newsgroups: gmane.emacs.help Subject: Re: shift+left/right arrow cannot be bound in Emacs Date: Mon, 14 Sep 2015 21:52:06 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <87fv2huii8.fsf@mat.ucm.es> <87egi1dk0g.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1442267721 9395 80.91.229.3 (14 Sep 2015 21:55:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2015 21:55:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 14 23:55:21 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zbbib-0003Dh-A2 for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Sep 2015 23:55:21 +0200 Original-Received: from localhost ([::1]:43715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zbbia-0007vQ-PW for geh-help-gnu-emacs@m.gmane.org; Mon, 14 Sep 2015 17:55:20 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!nntpspool01.opticnetworks.net!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: 6vJ9bD1ekW8t4acxAcHFJw.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (Linux/3.18.6-1-ARCH (x86_64)) X-Notice: Filtered by postfilter v. 0.8.2 Original-Xref: usenet.stanford.edu gnu.emacs.help:214924 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107208 Archived-At: >> In my Emacs 25.0.50.1 on Kubuntu 15.04 asking for the current binding >> with C-h k shift+left shows > >> (translated from ) 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)