Re: org-insert-structure-template

2022-12-29 Thread Ihor Radchenko
Ihor Radchenko  writes:

> C-c C-x , is actually not available (it is bound to timer).
> I went with C-c C-x s.
>
> See the attached patch.

Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5bc5add32

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org-insert-structure-template

2022-12-13 Thread Ihor Radchenko
Anthony Carrico  writes:

>> The general pattern is C-c C-x . Maybe we can add "C-c C-x ,"?
>
> Thanks, that is probably a good pattern to use. I'll look into 
> org-use-extra-keys. This is the only keybinding that regularly bites me 
> on the TTY.

C-c C-x , is actually not available (it is bound to timer).
I went with C-c C-x s.

See the attached patch.

>From 2646a3279689cd9afdf4b5b0e44d29c1fca38d84 Mon Sep 17 00:00:00 2001
Message-Id: <2646a3279689cd9afdf4b5b0e44d29c1fca38d84.1670924473.git.yanta...@posteo.net>
From: Ihor Radchenko 
Date: Tue, 13 Dec 2022 12:30:36 +0300
Subject: [PATCH] lisp/org-keys.el: Provide terminal binding for
 `org-insert-structure-template'

* lisp/org-keys.el (or): Add alternative terminal binding for
`org-insert-structure-template'.  The default binding may not be
available in some terminals.

* doc/org-manual.org (Using Org on a TTY): List the new binding in the
manual.

Reported-by: Anthony Carrico 
Link: https://orgmode.org/list/d9222967-5747-bf54-8041-4a8453fe8...@memebeam.org
---
 doc/org-manual.org | 1 +
 lisp/org-keys.el   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 0680fb593..1431f8546 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -20481,6 +20481,7 @@ ** Using Org on a TTY
 | {{{kbd(S-DOWN)}}}| {{{kbd(C-c DOWN)}}}  |  |  |
 | {{{kbd(C-S-LEFT)}}}  | {{{kbd(C-c C-x LEFT)}}}  |  |  |
 | {{{kbd(C-S-RIGHT)}}} | {{{kbd(C-c C-x RIGHT)}}} |  |  |
+| {{{kbd(C-c C-\,)}}}  | {{{kbd(C-c C-x s)}}} |  |  |
 
 ** Protocols for External Access
 :PROPERTIES:
diff --git a/lisp/org-keys.el b/lisp/org-keys.el
index 95f64a3f9..7c6e38e64 100644
--- a/lisp/org-keys.el
+++ b/lisp/org-keys.el
@@ -503,6 +503,7 @@ (when (or org-use-extra-keys (not (display-graphic-p)))
   (org-defkey org-mode-map (kbd "C-c C-x c") #'org-table-copy-down)
   (org-defkey org-mode-map (kbd "C-c C-x m") #'org-meta-return)
   (org-defkey org-mode-map (kbd "C-c C-x M") #'org-insert-todo-heading)
+  (org-defkey org-mode-map (kbd "C-c C-x s") #'org-insert-structure-template)
   (org-defkey org-mode-map (kbd "C-c C-x RET") #'org-meta-return)
   (org-defkey org-mode-map (kbd "ESC RET") #'org-meta-return)
   (org-defkey org-mode-map (kbd "ESC ") #'org-metaleft)
-- 
2.38.1



-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 


Re: org-insert-structure-template

2022-12-12 Thread Tim Cross


Anthony Carrico  writes:

> I'm trying to remember what the old keybinding was before it got switched to 
> 'C-c C-,'...

IIRC there wasn't one.


Previously, a completely different system was used for adding these
templates and it was bound to  <  (or was it >, I cannot remember).

The problem was that the old 'template' system was not terribly
flexible/powerful. For example, you could not mark a region, call tte
template function and have it wrap the template around the marked
region. 



Re: org-insert-structure-template

2022-12-12 Thread Alain . Cochard
Anthony Carrico writes on Mon 12 Dec 2022 09:41:
 > On 12/12/22 09:20, alain.coch...@unistra.fr wrote:
 > > Perhaps you have in min >
 > >'<', followed by a template selector and '
 > 
 > Yes!
 
 > Was this deprecated because it isn't a regular emacs keybinding?

I don't remember.  It was debated in the past.  Hopefully someone else
can summarize it.  Otherwise, perhaps start with:

https://list.orgmode.org/87lgd671k7@bzg.fr/


-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




Re: org-insert-structure-template

2022-12-12 Thread Anthony Carrico

On 12/12/22 09:20, alain.coch...@unistra.fr wrote:

Perhaps you have in min >
   '<', followed by a template selector and '


Yes! I didn't realize that could be enabled. I trained myself not to 
rely on this when the new keybinding came. Only recently did I realize 
the reason the new keybinding is sometimes unreliable is the limited 
ASCII control keys on the TTY.


Thanks!

Was this deprecated because it isn't a regular emacs keybinding?

--
Anthony Carrico



Re: org-insert-structure-template

2022-12-12 Thread Anthony Carrico

On 12/12/22 09:04, Ihor Radchenko wrote:

Note that we have alternative key bindings for TTY. See
`org-use-extra-keys'.

The general pattern is C-c C-x . Maybe we can add "C-c C-x ,"?


Thanks, that is probably a good pattern to use. I'll look into 
org-use-extra-keys. This is the only keybinding that regularly bites me 
on the TTY.


--
Anthony Carrico



Re: org-insert-structure-template

2022-12-12 Thread Alain . Cochard
Anthony Carrico writes on Mon 12 Dec 2022 08:50:

 > I'm trying to remember what the old keybinding was before it got
 > switched to 'C-c C-,'...

Perhaps you have in mind

  '<', followed by a template selector and '

?

See 17.2 Structure Templates:

   For example, ‘< s ’ creates a code block.  Enable it by
   customizing ‘org-modules’ or add ‘(require 'org-tempo)’ to your
   Emacs init file

-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




Re: org-insert-structure-template

2022-12-12 Thread Ihor Radchenko
Anthony Carrico  writes:

> I use this command all the time because the literal syntax is so heavy. 
> The problem is that the current keybinding is not available on the TTY, 
> and every time I use it there I get org-priority which is bound to 'C-c 
> ,'. Does anyone else find this frustrating? Which keybinding do you use 
> for org-insert-structure-template? I don't think I've ever used 
> org-priority, so I'll probably just rebind 'C-c ,' to fix the problem.

Note that we have alternative key bindings for TTY. See
`org-use-extra-keys'.

The general pattern is C-c C-x . Maybe we can add "C-c C-x ,"?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org-insert-structure-template

2022-12-12 Thread Anthony Carrico
I'm trying to remember what the old keybinding was before it got 
switched to 'C-c C-,'...


--
Anthony Carrico