unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
@ 2020-10-12 11:36 Andrii Kolomoiets
  2020-10-12 18:33 ` Alan Third
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Andrii Kolomoiets @ 2020-10-12 11:36 UTC (permalink / raw)
  To: 43948

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

On macOS, 'Command-Left/Right Arrow' are the common shortcuts to move
the insertion point to the beginning/end of line.

See https://support.apple.com/en-us/HT201236, 'Document shortcuts'
section.

Considering that Emacs is the text editor (mostly), lets make it behave
more like TextEdit.app and not like Terminal.app about those shortcuts.

Patch attached.

Thanks!

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-NS-Make-s-left-right-to-move-to-beginning-end-of-lin.patch --]
[-- Type: text/x-patch, Size: 1694 bytes --]

From ccea06f8b53589cdb1dff20e91f33fd8b8beb0a3 Mon Sep 17 00:00:00 2001
From: Andrii Kolomoiets <andreyk.mad@gmail.com>
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            | 4 ++++
 lisp/term/ns-win.el | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index cc8733c2c0..c7b34bdc1c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1683,6 +1683,10 @@ 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.
+
 \f
 ----------------------------------------------------------------------
 This file is part of GNU Emacs.
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index cc7a3762b4..28bb851b30 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -148,9 +148,9 @@ 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)
+;; (as in TextEdit.app)
+(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


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-12 11:36 bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line Andrii Kolomoiets
@ 2020-10-12 18:33 ` Alan Third
  2020-10-13  6:48   ` Andrii Kolomoiets
  2020-10-12 22:38 ` Unknown
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 22+ messages in thread
From: Alan Third @ 2020-10-12 18:33 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 43948

On Mon, Oct 12, 2020 at 02:36:53PM +0300, Andrii Kolomoiets wrote:
> On macOS, 'Command-Left/Right Arrow' are the common shortcuts to move
> the insertion point to the beginning/end of line.
> 
> See https://support.apple.com/en-us/HT201236, 'Document shortcuts'
> section.
> 
> Considering that Emacs is the text editor (mostly), lets make it behave
> more like TextEdit.app and not like Terminal.app about those shortcuts.
> 
> Patch attached.

Thanks for this.

> +;; (as in TextEdit.app)

As these bindings are standard for the OS, I don't think we really
need this comment. :)

I want to leave this a little while to see if anyone objects, then we
can put it into master and see if anyone objects then.

Feel free to remind me about this in a week or so if I forget and
nobody else responds.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-12 11:36 bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line Andrii Kolomoiets
  2020-10-12 18:33 ` Alan Third
@ 2020-10-12 22:38 ` Unknown
  2020-10-13  7:57   ` Andrii Kolomoiets
  2020-10-20  9:55 ` bug#43948: 28.0.50; [PATCH][NS] " Mattias Engdegård
  2020-11-12  4:52 ` bug#43948: 28.0.50; [PATHC][NS] " tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  3 siblings, 1 reply; 22+ messages in thread
From: Unknown @ 2020-10-12 22:38 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 43948

Andrii Kolomoiets <andreyk.mad@gmail.com> writes:

Thanks for the patch, I think it's a good addition. I only have a nit:

> +--
> +** 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.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-12 18:33 ` Alan Third
@ 2020-10-13  6:48   ` Andrii Kolomoiets
  2020-10-13 20:35     ` Alan Third
  0 siblings, 1 reply; 22+ messages in thread
From: Andrii Kolomoiets @ 2020-10-13  6:48 UTC (permalink / raw)
  To: Alan Third; +Cc: 43948

Alan Third <alan@idiocy.org> writes:

> As these bindings are standard for the OS, I don't think we really
> need this comment. :)

Yes.  Will you be able to remove it while applying changes or should I
update the patch?

> Feel free to remind me about this in a week or so if I forget and
> nobody else responds.

Sure.  But I believe no bug report will go unattended nowadays thanks to
Lars :)





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-12 22:38 ` Unknown
@ 2020-10-13  7:57   ` Andrii Kolomoiets
  2020-10-13 20:36     ` Alan Third
  0 siblings, 1 reply; 22+ messages in thread
From: Andrii Kolomoiets @ 2020-10-13  7:57 UTC (permalink / raw)
  To: Daniel Martín; +Cc: 43948

Daniel Martín <mardani29@yahoo.es> 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.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-13  6:48   ` Andrii Kolomoiets
@ 2020-10-13 20:35     ` Alan Third
  0 siblings, 0 replies; 22+ messages in thread
From: Alan Third @ 2020-10-13 20:35 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 43948

On Tue, Oct 13, 2020 at 09:48:13AM +0300, Andrii Kolomoiets wrote:
> Alan Third <alan@idiocy.org> writes:
> 
> > As these bindings are standard for the OS, I don't think we really
> > need this comment. :)
> 
> Yes.  Will you be able to remove it while applying changes or should I
> update the patch?

I can do it, although if you're wanting to change the NEWS entry I
suppose it would make sense to do it all at once.

-- 
Alan Third





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-13  7:57   ` Andrii Kolomoiets
@ 2020-10-13 20:36     ` Alan Third
  2020-10-14 10:15       ` Andrii Kolomoiets
  0 siblings, 1 reply; 22+ messages in thread
From: Alan Third @ 2020-10-13 20:36 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: Daniel Martín, 43948

On Tue, Oct 13, 2020 at 10:57:11AM +0300, Andrii Kolomoiets wrote:
> Daniel Martín <mardani29@yahoo.es> 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.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-13 20:36     ` Alan Third
@ 2020-10-14 10:15       ` Andrii Kolomoiets
  2020-10-14 20:24         ` Alan Third
  0 siblings, 1 reply; 22+ messages in thread
From: Andrii Kolomoiets @ 2020-10-14 10:15 UTC (permalink / raw)
  To: Alan Third; +Cc: Daniel Martín, 43948

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

Alan Third <alan@idiocy.org> writes:

> On Tue, Oct 13, 2020 at 10:57:11AM +0300, Andrii Kolomoiets wrote:
>> Daniel Martín <mardani29@yahoo.es> 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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-NS-Make-s-left-right-to-move-to-beginning-end-of-lin.patch --]
[-- Type: text/x-patch, Size: 1756 bytes --]

From 52c5b246b010b06f62d656811cf3a772399f0c18 Mon Sep 17 00:00:00 2001
From: Andrii Kolomoiets <andreyk.mad@gmail.com>
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-`'.
+
 \f
 ----------------------------------------------------------------------
 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


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-14 10:15       ` Andrii Kolomoiets
@ 2020-10-14 20:24         ` Alan Third
  2020-10-14 20:48           ` Andrii Kolomoiets
  0 siblings, 1 reply; 22+ messages in thread
From: Alan Third @ 2020-10-14 20:24 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: Daniel Martín, 43948

On Wed, Oct 14, 2020 at 01:15:51PM +0300, Andrii Kolomoiets wrote:
> > Yes, I think that mentioning those keys is better.
> 
> Done.

Thanks.

> +** On macOS, 's-<left>' and 's-<right> are now bound to
                                         ^
Missing quote.

> +'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-`'.

I don't think you need the word "former" here. Other than that, LGTM.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-14 20:24         ` Alan Third
@ 2020-10-14 20:48           ` Andrii Kolomoiets
  2020-11-09 14:55             ` Alan Third
  0 siblings, 1 reply; 22+ messages in thread
From: Andrii Kolomoiets @ 2020-10-14 20:48 UTC (permalink / raw)
  To: Alan Third; +Cc: Daniel Martín, 43948

[-- Attachment #1: Type: text/plain, Size: 487 bytes --]

Alan Third <alan@idiocy.org> writes:

>> +** On macOS, 's-<left>' and 's-<right> are now bound to
>                                          ^
> Missing quote.

Fixed.
Smells like bug report for electric-pair-mode to pair "'" in text-mode :)

>
>> +'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-`'.
>
> I don't think you need the word "former" here. Other than that, LGTM.

And fixed.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-NS-Make-s-left-right-to-move-to-beginning-end-of-lin.patch --]
[-- Type: text/x-patch, Size: 1750 bytes --]

From edb8467d3884067f88c2349cb30bd38a6a3d40b9 Mon Sep 17 00:00:00 2001
From: Andrii Kolomoiets <andreyk.mad@gmail.com>
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..8cb9ecc102 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 commands
+to select previous/next frame are still bound to 's-~' and 's-`'.
+
 \f
 ----------------------------------------------------------------------
 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


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATCH][NS] Make s-<left/right> to move to  beginning/end of line
  2020-10-12 11:36 bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line Andrii Kolomoiets
  2020-10-12 18:33 ` Alan Third
  2020-10-12 22:38 ` Unknown
@ 2020-10-20  9:55 ` Mattias Engdegård
  2020-10-20 12:33   ` Alan Third
  2020-10-20 16:06   ` Drew Adams
  2020-11-12  4:52 ` bug#43948: 28.0.50; [PATHC][NS] " tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  3 siblings, 2 replies; 22+ messages in thread
From: Mattias Engdegård @ 2020-10-20  9:55 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: Alan Third, 43948, Daniel Martín

Similarly, should M-mouse-1 be bound to rectangular selection, since Option-drag-mouse appears to be the platform convention?
(It seems unlikely that there would be a sizeable population of secondary selection users on NS, but what do I know.)






^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATCH][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-20  9:55 ` bug#43948: 28.0.50; [PATCH][NS] " Mattias Engdegård
@ 2020-10-20 12:33   ` Alan Third
  2020-10-20 13:54     ` Mattias Engdegård
  2020-10-20 16:06   ` Drew Adams
  1 sibling, 1 reply; 22+ messages in thread
From: Alan Third @ 2020-10-20 12:33 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: 43948, Andrii Kolomoiets, Daniel Martín

On Tue, Oct 20, 2020 at 11:55:36AM +0200, Mattias Engdegård wrote:
> Similarly, should M-mouse-1 be bound to rectangular selection, since
> Option-drag-mouse appears to be the platform convention? (It seems
> unlikely that there would be a sizeable population of secondary
> selection users on NS, but what do I know.)

I'm not sure. I'm happy enough with the super bindings since I don't
think Emacs has any by default, but I don't know that we want to get
into other bindings with a greater potential for conflict.
-- 
Alan Third





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATCH][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-20 12:33   ` Alan Third
@ 2020-10-20 13:54     ` Mattias Engdegård
  0 siblings, 0 replies; 22+ messages in thread
From: Mattias Engdegård @ 2020-10-20 13:54 UTC (permalink / raw)
  To: Alan Third; +Cc: 43948, Andrii Kolomoiets, Daniel Martín

20 okt. 2020 kl. 14.33 skrev Alan Third <alan@idiocy.org>:

> I'm not sure. I'm happy enough with the super bindings since I don't
> think Emacs has any by default, but I don't know that we want to get
> into other bindings with a greater potential for conflict.

Thank you, and I do have some sympathy for that point of view. It seems that we can't ever replace any bindings, no matter how rarely used, but that's not your fault.






^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATCH][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-20  9:55 ` bug#43948: 28.0.50; [PATCH][NS] " Mattias Engdegård
  2020-10-20 12:33   ` Alan Third
@ 2020-10-20 16:06   ` Drew Adams
  1 sibling, 0 replies; 22+ messages in thread
From: Drew Adams @ 2020-10-20 16:06 UTC (permalink / raw)
  To: Mattias Engdegård, Andrii Kolomoiets
  Cc: Alan Third, 43948, Daniel Martín

> Similarly, should M-mouse-1 be bound to rectangular selection, since Option-
> drag-mouse appears to be the platform convention?
> (It seems unlikely that there would be a sizeable population of secondary
> selection users on NS, but what do I know.)

FWIW -

The secondary selection is, I think, simply not
as well known as it could/should be.  I think
that if more people were aware if it they would
use it.

But the main reason, I think, that people aren't
aware of it, and also a reason they might not
use it even if they were aware of it, is that it
has no keyboard key bindings, by default.
___

My library second-sel.el provides additional
ways to obtain and use the secondary selection,
including obtaining it from the primary - and
vice versa, yanking it (including in Isearch),
and having its own ring (a la `kill-ring').

Suggested keyboard keys for it:

C-M-y       - yank, by default

  prefix arg:   0 - select it as region
              > 0 - move it to region's text
              < 0 - swap it with region

M-y         - yank from kill or secondary ring
              depending on previous command

C-x C-M-SPC - set start of secondary at point
C-x C-M-<return> - `secondary-save-then-kill'
                   does the same as `M-mouse-3'

https://www.emacswiki.org/emacs/SecondarySelection#second-sel.el





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-10-14 20:48           ` Andrii Kolomoiets
@ 2020-11-09 14:55             ` Alan Third
  0 siblings, 0 replies; 22+ messages in thread
From: Alan Third @ 2020-11-09 14:55 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: 43948-done, Daniel Martín

On Wed, Oct 14, 2020 at 11:48:29PM +0300, Andrii Kolomoiets wrote:
> Alan Third <alan@idiocy.org> writes:
> 
> >> +** On macOS, 's-<left>' and 's-<right> are now bound to
> >                                          ^
> > Missing quote.
> 
> Fixed.
> Smells like bug report for electric-pair-mode to pair "'" in text-mode :)
> 
> >
> >> +'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-`'.
> >
> > I don't think you need the word "former" here. Other than that, LGTM.
> 
> And fixed.

I've pushed this to master.

Thanks!
-- 
Alan Third





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to  beginning/end of line
  2020-10-12 11:36 bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line Andrii Kolomoiets
                   ` (2 preceding siblings ...)
  2020-10-20  9:55 ` bug#43948: 28.0.50; [PATCH][NS] " Mattias Engdegård
@ 2020-11-12  4:52 ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-12  9:06   ` Andrii Kolomoiets
  2020-11-13  5:32   ` Richard Stallman
  3 siblings, 2 replies; 22+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-11-12  4:52 UTC (permalink / raw)
  To: andreyk.mad, Alan Third; +Cc: 43948

(Sorry for late reply)

macOS’s 'Command-Left/Right Arrow’ is not same as 'Control-A/E'.

Why not use beginning-of-visual-line/end-of-visual-line?

--
tsuucat




^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-11-12  4:52 ` bug#43948: 28.0.50; [PATHC][NS] " tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-11-12  9:06   ` Andrii Kolomoiets
  2020-11-12 10:04     ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-12 14:39     ` Eli Zaretskii
  2020-11-13  5:32   ` Richard Stallman
  1 sibling, 2 replies; 22+ messages in thread
From: Andrii Kolomoiets @ 2020-11-12  9:06 UTC (permalink / raw)
  To: tsuucat; +Cc: Alan Third, 43948

tsuucat <tsuucat@icloud.com> writes:

> macOS’s 'Command-Left/Right Arrow’ is not same as 'Control-A/E'.
>
> Why not use beginning-of-visual-line/end-of-visual-line?

Isn't the visual-line-mode designed for this?

I see two issues with binding s-<right> to end-of-visual-line:

1. emacs -Q
2. M-: (set-frame-width nil 50)
3. M-<
4. M-x end-of-visual-line
The point moved to the beginning of the next visual line
5. M-<
6. M-x toggle-truncate-lines
7. M-x end-of-visual-line
The point is not moved to the end of the line.  Other macos apps will
move point to the end of the line.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to  beginning/end of line
  2020-11-12  9:06   ` Andrii Kolomoiets
@ 2020-11-12 10:04     ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-12 14:39     ` Eli Zaretskii
  1 sibling, 0 replies; 22+ messages in thread
From: tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-11-12 10:04 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: Alan Third, 43948



> Andrii Kolomoiets <andreyk.mad@gmail.com> writes:
> 
> tsuucat <tsuucat@icloud.com> writes:
> 
>> macOS’s 'Command-Left/Right Arrow’ is not same as 'Control-A/E'.
>> 
>> Why not use beginning-of-visual-line/end-of-visual-line?
> 
> Isn't the visual-line-mode designed for this?
> 
> I see two issues with binding s-<right> to end-of-visual-line:
> 
> 1. emacs -Q
> 2. M-: (set-frame-width nil 50)
> 3. M-<
> 4. M-x end-of-visual-line
> The point moved to the beginning of the next visual line
> 5. M-<
> 6. M-x toggle-truncate-lines
> 7. M-x end-of-visual-line
> The point is not moved to the end of the line.  Other macos apps will
> move point to the end of the line.

I confirmed M-x end-of-visual-line behaves differently with visual-line-mode
enabled than it does with visual-line-mode disabled (= end-of-visual-line is
intended with visual-line-mode enabled).

So Emacs doesn’t provide macOS 'Command-Left/Right Arrow’ equivalent
commands but using move-(beginning|end)-of-line is the most suitable choice.

Sorry for the noise. 🙇




^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-11-12  9:06   ` Andrii Kolomoiets
  2020-11-12 10:04     ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2020-11-12 14:39     ` Eli Zaretskii
  2020-11-12 23:20       ` Andrii Kolomoiets
  1 sibling, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2020-11-12 14:39 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: alan, tsuucat, 43948

> From: Andrii Kolomoiets <andreyk.mad@gmail.com>
> Date: Thu, 12 Nov 2020 11:06:02 +0200
> Cc: Alan Third <alan@idiocy.org>, 43948@debbugs.gnu.org
> 
> 2. M-: (set-frame-width nil 50)
> 3. M-<
> 4. M-x end-of-visual-line
> The point moved to the beginning of the next visual line

What else did you expect, in a continued line?  There's no place to
show the cursor except at the beginning of the next screen line.

> 5. M-<
> 6. M-x toggle-truncate-lines
> 7. M-x end-of-visual-line
> The point is not moved to the end of the line.

It is, but you need to disable auto-hscroll-mode to see that.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-11-12 14:39     ` Eli Zaretskii
@ 2020-11-12 23:20       ` Andrii Kolomoiets
  2020-11-13  8:05         ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Andrii Kolomoiets @ 2020-11-12 23:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: alan, tsuucat, 43948

Eli Zaretskii <eliz@gnu.org> writes:

>> 2. M-: (set-frame-width nil 50)
>> 3. M-<
>> 4. M-x end-of-visual-line
>> The point moved to the beginning of the next visual line
>
> What else did you expect, in a continued line?  There's no place to
> show the cursor except at the beginning of the next screen line.

Well, sometimes the cursor is on the fringe.  With "bar" cursor type
this leads to interesting behavior:
emacs -Q
M-: (set-frame-width nil 70)
M-: (setq cursor-type 'bar)

Now it's easy to place the cursor after the "." on the first line:
M-< C-e
But it is not possible to place the cursor after last "e" on the second
line.

IIRC it's because the cursor is actually "on" some character and not
"before" or "after" it.  And at the end of the first line the cursor is
on the "new line" character.

>> 5. M-<
>> 6. M-x toggle-truncate-lines
>> 7. M-x end-of-visual-line
>> The point is not moved to the end of the line.
>
> It is, but you need to disable auto-hscroll-mode to see that.

Yes, the point is correctly moved to the end of visual line.

I didn't mean to say the behavior of the 'end-of-visual-line' function
is wrong.  I tried to say that behavior of the 'end-of-visual-line'
function outside the 'visual-line-mode' can be surprising for the users
who press Command-<Right Arrow> to go to the end of the line.





^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to  beginning/end of line
  2020-11-12  4:52 ` bug#43948: 28.0.50; [PATHC][NS] " tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-11-12  9:06   ` Andrii Kolomoiets
@ 2020-11-13  5:32   ` Richard Stallman
  1 sibling, 0 replies; 22+ messages in thread
From: Richard Stallman @ 2020-11-13  5:32 UTC (permalink / raw)
  To: tsuucat; +Cc: alan, andreyk.mad, 43948

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Emacs commands should be compatible across operating systems.
We should not vary the meanings of text editing commands based
on platform.

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







^ permalink raw reply	[flat|nested] 22+ messages in thread

* bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line
  2020-11-12 23:20       ` Andrii Kolomoiets
@ 2020-11-13  8:05         ` Eli Zaretskii
  0 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2020-11-13  8:05 UTC (permalink / raw)
  To: Andrii Kolomoiets; +Cc: alan, tsuucat, 43948

> From: Andrii Kolomoiets <andreyk.mad@gmail.com>
> Cc: tsuucat@icloud.com,  alan@idiocy.org,  43948@debbugs.gnu.org
> Date: Fri, 13 Nov 2020 01:20:36 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> 2. M-: (set-frame-width nil 50)
> >> 3. M-<
> >> 4. M-x end-of-visual-line
> >> The point moved to the beginning of the next visual line
> >
> > What else did you expect, in a continued line?  There's no place to
> > show the cursor except at the beginning of the next screen line.
> 
> Well, sometimes the cursor is on the fringe.

Can't be done in this case, because the fringe is "taken" by the
continuation bitmap.

> With "bar" cursor type this leads to interesting behavior:
> emacs -Q
> M-: (set-frame-width nil 70)
> M-: (setq cursor-type 'bar)
> 
> Now it's easy to place the cursor after the "." on the first line:
> M-< C-e
> But it is not possible to place the cursor after last "e" on the second
> line.
> 
> IIRC it's because the cursor is actually "on" some character and not
> "before" or "after" it.

Technically, because we decide where to place the cursor before we
know what is the shape of the cursor.  And yes, we draw the cursor
inside a certain character cell (because that's what users generally
expect).

> And at the end of the first line the cursor is on the "new line"
> character.

Right.

> I didn't mean to say the behavior of the 'end-of-visual-line' function
> is wrong.  I tried to say that behavior of the 'end-of-visual-line'
> function outside the 'visual-line-mode' can be surprising for the users
> who press Command-<Right Arrow> to go to the end of the line.

Agreed.





^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-11-13  8:05 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12 11:36 bug#43948: 28.0.50; [PATHC][NS] Make s-<left/right> to move to beginning/end of line Andrii Kolomoiets
2020-10-12 18:33 ` Alan Third
2020-10-13  6:48   ` Andrii Kolomoiets
2020-10-13 20:35     ` Alan Third
2020-10-12 22:38 ` Unknown
2020-10-13  7:57   ` Andrii Kolomoiets
2020-10-13 20:36     ` Alan Third
2020-10-14 10:15       ` Andrii Kolomoiets
2020-10-14 20:24         ` Alan Third
2020-10-14 20:48           ` Andrii Kolomoiets
2020-11-09 14:55             ` Alan Third
2020-10-20  9:55 ` bug#43948: 28.0.50; [PATCH][NS] " Mattias Engdegård
2020-10-20 12:33   ` Alan Third
2020-10-20 13:54     ` Mattias Engdegård
2020-10-20 16:06   ` Drew Adams
2020-11-12  4:52 ` bug#43948: 28.0.50; [PATHC][NS] " tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-12  9:06   ` Andrii Kolomoiets
2020-11-12 10:04     ` tsuucat via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-11-12 14:39     ` Eli Zaretskii
2020-11-12 23:20       ` Andrii Kolomoiets
2020-11-13  8:05         ` Eli Zaretskii
2020-11-13  5:32   ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).