Subject: bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line

From: Andrii Kolomoiets <[email-masked]>
Date: Wed, 14 Oct 2020 13:15:51 +0300

Alan Third <[email-masked]> writes:

> On Tue, Oct 13, 2020 at 10:57:11AM +0300, Andrii Kolomoiets wrote:
>> Daniel Martín <[email-masked]> writes:
>> 
>> >> +** On macOS, 's-<left>' and 's-<right> are now bound to
>> >> +'move-beginning-of-line' and 'move-end-of-line' respectively.
>> >> +
>> >
>> > Maybe we should say here that the former commands for these keys can
>> > still be invoked via M-x ns-prev-frame and M-x ns-next-frame,
>> > respectively.
>> 
>> Former commands can be invoked with 's-`' and 's-~'.  Those are the
>> common shortcuts in macOS.  So maybe it is better to mention those keys
>> instead of M-x?  Though I'm not the experienced NEWS writer.
>
> Yes, I think that mentioning those keys is better.

Done.

See attached patch.
>From 52c5b246b010b06f62d656811cf3a772399f0c18 Mon Sep 17 00:00:00 2001
From: Andrii Kolomoiets <[email-masked]>
Date: Mon, 12 Oct 2020 14:24:25 +0300
Subject: [PATCH] NS: Make s-<left/right> to move to beginning/end of line

* lisp/term/ns-win.el: Bind 's-<left>' to 'move-beginning-of-line';
bind 's-<right>' to 'move-end-of-line'.
* etc/NEWS: Mention new bindings.
---
 etc/NEWS            | 5 +++++
 lisp/term/ns-win.el | 5 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index cc8733c2c0..f6f4c2e057 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1683,6 +1683,11 @@ image API via 'M-x report-emacs-bug'.
 ---
 ** The user option 'make-pointer-invisible' is now honored on macOS.
 
+--
+** On macOS, 's-<left>' and 's-<right> are now bound to
+'move-beginning-of-line' and 'move-end-of-line' respectively. The former
+commands to select previous/next frame are still bound to 's-~' and 's-`'.
+
 
 ----------------------------------------------------------------------
 This file is part of GNU Emacs.
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index cc7a3762b4..8273c067f8 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -148,9 +148,8 @@ global-map
 (define-key global-map [?\s-|] 'shell-command-on-region)
 (define-key global-map [s-kp-bar] 'shell-command-on-region)
 (define-key global-map [?\C-\s- ] 'ns-do-show-character-palette)
-;; (as in Terminal.app)
-(define-key global-map [s-right] 'ns-next-frame)
-(define-key global-map [s-left] 'ns-prev-frame)
+(define-key global-map [s-right] 'move-end-of-line)
+(define-key global-map [s-left] 'move-beginning-of-line)
 
 (define-key global-map [home] 'beginning-of-buffer)
 (define-key global-map [end] 'end-of-buffer)
-- 
2.15.1