emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-insert-structure-template
@ 2022-12-12 13:46 Anthony Carrico
  2022-12-12 13:50 ` org-insert-structure-template Anthony Carrico
  2022-12-12 14:04 ` org-insert-structure-template Ihor Radchenko
  0 siblings, 2 replies; 10+ messages in thread
From: Anthony Carrico @ 2022-12-12 13:46 UTC (permalink / raw)
  To: emacs-orgmode

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.

‘C-c C-,’ (‘org-insert-structure-template’)
      Prompt for a type of block structure, and insert the block at
      point.  If the region is active, it is wrapped in the block.  First
      prompts the user for keys, which are used to look up a structure
      type from the variable below.  If the key is ‘<TAB>’, ‘<RET>’, or
      ‘<SPC>’, the user is prompted to enter a block type.

-- 
Anthony Carrico


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

* Re: org-insert-structure-template
  2022-12-12 13:46 org-insert-structure-template Anthony Carrico
@ 2022-12-12 13:50 ` Anthony Carrico
  2022-12-12 14:20   ` org-insert-structure-template Alain.Cochard
  2022-12-12 20:01   ` org-insert-structure-template Tim Cross
  2022-12-12 14:04 ` org-insert-structure-template Ihor Radchenko
  1 sibling, 2 replies; 10+ messages in thread
From: Anthony Carrico @ 2022-12-12 13:50 UTC (permalink / raw)
  To: emacs-orgmode

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

-- 
Anthony Carrico


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

* Re: org-insert-structure-template
  2022-12-12 13:46 org-insert-structure-template Anthony Carrico
  2022-12-12 13:50 ` org-insert-structure-template Anthony Carrico
@ 2022-12-12 14:04 ` Ihor Radchenko
  2022-12-12 14:35   ` org-insert-structure-template Anthony Carrico
  1 sibling, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2022-12-12 14:04 UTC (permalink / raw)
  To: Anthony Carrico; +Cc: emacs-orgmode

Anthony Carrico <acarrico@memebeam.org> 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 <key>. Maybe we can add "C-c C-x ,"?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: org-insert-structure-template
  2022-12-12 13:50 ` org-insert-structure-template Anthony Carrico
@ 2022-12-12 14:20   ` Alain.Cochard
  2022-12-12 14:41     ` org-insert-structure-template Anthony Carrico
  2022-12-12 20:01   ` org-insert-structure-template Tim Cross
  1 sibling, 1 reply; 10+ messages in thread
From: Alain.Cochard @ 2022-12-12 14:20 UTC (permalink / raw)
  To: Anthony Carrico; +Cc: emacs-orgmode

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 '<TAB'>

?

See 17.2 Structure Templates:

   For example, ‘< s <TAB>’ 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.cochard@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 ]



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

* Re: org-insert-structure-template
  2022-12-12 14:04 ` org-insert-structure-template Ihor Radchenko
@ 2022-12-12 14:35   ` Anthony Carrico
  2022-12-13  9:42     ` org-insert-structure-template Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Anthony Carrico @ 2022-12-12 14:35 UTC (permalink / raw)
  To: emacs-orgmode

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


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

* Re: org-insert-structure-template
  2022-12-12 14:20   ` org-insert-structure-template Alain.Cochard
@ 2022-12-12 14:41     ` Anthony Carrico
  2022-12-12 14:56       ` org-insert-structure-template Alain.Cochard
  0 siblings, 1 reply; 10+ messages in thread
From: Anthony Carrico @ 2022-12-12 14:41 UTC (permalink / raw)
  To: emacs-orgmode

On 12/12/22 09:20, Alain.Cochard@unistra.fr wrote:
> Perhaps you have in min >
>    '<', followed by a template selector and '<TAB'>

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


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

* Re: org-insert-structure-template
  2022-12-12 14:41     ` org-insert-structure-template Anthony Carrico
@ 2022-12-12 14:56       ` Alain.Cochard
  0 siblings, 0 replies; 10+ messages in thread
From: Alain.Cochard @ 2022-12-12 14:56 UTC (permalink / raw)
  To: Anthony Carrico; +Cc: emacs-orgmode

Anthony Carrico writes on Mon 12 Dec 2022 09:41:
 > On 12/12/22 09:20, Alain.Cochard@unistra.fr wrote:
 > > Perhaps you have in min >
 > >    '<', followed by a template selector and '<TAB'>
 > 
 > 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.fsf@bzg.fr/


-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.cochard@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 ]



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

* Re: org-insert-structure-template
  2022-12-12 13:50 ` org-insert-structure-template Anthony Carrico
  2022-12-12 14:20   ` org-insert-structure-template Alain.Cochard
@ 2022-12-12 20:01   ` Tim Cross
  1 sibling, 0 replies; 10+ messages in thread
From: Tim Cross @ 2022-12-12 20:01 UTC (permalink / raw)
  To: emacs-orgmode


Anthony Carrico <acarrico@memebeam.org> 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. 


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

* Re: org-insert-structure-template
  2022-12-12 14:35   ` org-insert-structure-template Anthony Carrico
@ 2022-12-13  9:42     ` Ihor Radchenko
  2022-12-29 14:28       ` org-insert-structure-template Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2022-12-13  9:42 UTC (permalink / raw)
  To: Anthony Carrico; +Cc: emacs-orgmode

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

Anthony Carrico <acarrico@memebeam.org> writes:

>> The general pattern is C-c C-x <key>. 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-org-keys.el-Provide-terminal-binding-for-org-in.patch --]
[-- Type: text/x-patch, Size: 2095 bytes --]

From 2646a3279689cd9afdf4b5b0e44d29c1fca38d84 Mon Sep 17 00:00:00 2001
Message-Id: <2646a3279689cd9afdf4b5b0e44d29c1fca38d84.1670924473.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
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 <acarrico@memebeam.org>
Link: https://orgmode.org/list/d9222967-5747-bf54-8041-4a8453fe81fc@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 <left>") #'org-metaleft)
-- 
2.38.1


[-- Attachment #3: Type: text/plain, Size: 225 bytes --]



-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

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

* Re: org-insert-structure-template
  2022-12-13  9:42     ` org-insert-structure-template Ihor Radchenko
@ 2022-12-29 14:28       ` Ihor Radchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Ihor Radchenko @ 2022-12-29 14:28 UTC (permalink / raw)
  To: Anthony Carrico; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> 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 <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2022-12-29 14:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-12 13:46 org-insert-structure-template Anthony Carrico
2022-12-12 13:50 ` org-insert-structure-template Anthony Carrico
2022-12-12 14:20   ` org-insert-structure-template Alain.Cochard
2022-12-12 14:41     ` org-insert-structure-template Anthony Carrico
2022-12-12 14:56       ` org-insert-structure-template Alain.Cochard
2022-12-12 20:01   ` org-insert-structure-template Tim Cross
2022-12-12 14:04 ` org-insert-structure-template Ihor Radchenko
2022-12-12 14:35   ` org-insert-structure-template Anthony Carrico
2022-12-13  9:42     ` org-insert-structure-template Ihor Radchenko
2022-12-29 14:28       ` org-insert-structure-template 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).