[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Re: org-metashiftleft/right should honor org-support-shift-selec
From: |
Ihor Radchenko |
Subject: |
[PATCH] Re: org-metashiftleft/right should honor org-support-shift-select |
Date: |
Tue, 23 Nov 2021 21:27:54 +0800 |
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
>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