emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-metashiftleft/right should honor org-support-shift-select
@ 2021-11-15  3:47 Carlos Pita
  2021-11-23 13:27 ` [PATCH] " Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos Pita @ 2021-11-15  3:47 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

on macOS option-shift-left / right extend the selection by one word.
Emacs by default binds meta-shift-left / right in a way that is
compatible with the system shortcuts. But org-mode interferes with
these bindings even when org-support-shift-select is t. OTOH, an
effort has been done to support shift selection in
org-shiftcontrolleft / right. The problem is that macOS uses option
instead of control to achieve selection by word.

Best regards,
Carlos


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

* [PATCH] Re: org-metashiftleft/right should honor org-support-shift-select
  2021-11-15  3:47 org-metashiftleft/right should honor org-support-shift-select Carlos Pita
@ 2021-11-23 13:27 ` Ihor Radchenko
  2022-07-31  7:30   ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2021-11-23 13:27 UTC (permalink / raw)
  To: Carlos Pita; +Cc: emacs-orgmode

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

Carlos Pita <carlosjosepita2@gmail.com> writes:

> Hi all,
>
> on macOS option-shift-left / right extend the selection by one word.
> Emacs by default binds meta-shift-left / right in a way that is
> compatible with the system shortcuts. But org-mode interferes with
> these bindings even when org-support-shift-select is t. OTOH, an
> effort has been done to support shift selection in
> org-shiftcontrolleft / right. The problem is that macOS uses option
> instead of control to achieve selection by word.

Can you test the attached patch? I am not using MacOS.

Best,
Ihor


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Make-org-shiftmetaleft-org-shiftmetaright-honour-shi.patch --]
[-- Type: text/x-diff, Size: 1822 bytes --]

From 77312a266c200a65a4a8cf63040e32357304396c Mon Sep 17 00:00:00 2001
Message-Id: <77312a266c200a65a4a8cf63040e32357304396c.1637674022.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Tue, 23 Nov 2021 21:24:52 +0800
Subject: [PATCH] Make org-shiftmetaleft/org-shiftmetaright honour shift-select
 on MacOS

* lisp/org.el (org-shiftmetaleft):
(org-shiftmetaright): Honour shift-select bound to meta-arrow on
MacOS when `org-support-shift-select' is non-nil.

Fixes https://orgmode.org/list/CAEOO5Tdg6sdjNfAg=J_DVQ50xx1oxaFaVyyYnda6O_-t3hG2jg@mail.gmail.com
---
 lisp/org.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 048abb142..a86ad301f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17378,6 +17378,10 @@ (defun org-shiftmetaleft ()
 individual commands for more information."
   (interactive)
   (cond
+   ((and (eq system-type 'darwin)
+         (or (eq org-support-shift-select 'always)
+             (and org-support-shift-select (org-region-active-p))))
+    (org-call-for-shift-select 'backward-char))
    ((run-hook-with-args-until-success 'org-shiftmetaleft-hook))
    ((org-at-table-p) (call-interactively 'org-table-delete-column))
    ((org-at-heading-p) (call-interactively 'org-promote-subtree))
@@ -17394,6 +17398,10 @@ (defun org-shiftmetaright ()
 individual commands for more information."
   (interactive)
   (cond
+   ((and (eq system-type 'darwin)
+         (or (eq org-support-shift-select 'always)
+             (and org-support-shift-select (org-region-active-p))))
+    (org-call-for-shift-select 'forward-char))
    ((run-hook-with-args-until-success 'org-shiftmetaright-hook))
    ((org-at-table-p) (call-interactively 'org-table-insert-column))
    ((org-at-heading-p) (call-interactively 'org-demote-subtree))
-- 
2.32.0


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

* Re: [PATCH] Re: org-metashiftleft/right should honor org-support-shift-select
  2021-11-23 13:27 ` [PATCH] " Ihor Radchenko
@ 2022-07-31  7:30   ` Ihor Radchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Ihor Radchenko @ 2022-07-31  7:30 UTC (permalink / raw)
  To: Carlos Pita; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@gmail.com> writes:

> Subject: [PATCH] Make org-shiftmetaleft/org-shiftmetaright honour shift-select
>  on MacOS

No response has been received. I decided to merge the patch.

Applied onto main via b4d7a24f0.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=b4d7a24f07c448a3ef714ee91d8ae7ac97b2d8cc

Best,
Ihor


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

end of thread, other threads:[~2022-07-31  7:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15  3:47 org-metashiftleft/right should honor org-support-shift-select Carlos Pita
2021-11-23 13:27 ` [PATCH] " Ihor Radchenko
2022-07-31  7:30   ` Ihor Radchenko

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).