emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [patch] Improved block insertion


From: Rasmus
Subject: [O] [patch] Improved block insertion
Date: Sat, 07 Apr 2018 21:01:10 +0200
User-agent: Emacs Gnus

Hi,

These patches improve the block insertion mechanisms using both the
keyboard binding and org-tempo.

I first sent these patches at Christmas, but did not have time to finish
them due to unexpected events.

On the Tempo side the cursor placement is a bit more clever.  For an
"empty" source blocks, the cursor will be placed after "#+begin_src ".
For other blocks, the cursor is placed on the first line after the
"#+begin"-line.  A better job is being done to detect changes.  Also, long
keys arre supported!

I have added a menu system to ‘org-insert-structure-template’ based on
‘org-mks’ to accommodate long keys.  It tries to make a menu of max two
keystrokes to insert a block.  One can also insert a manually typed block
by clicking tab/space/ret in the top menu.  An example of menu keys is
shown in the comments below.

Conflict resolution is somewhat brutal as the user is prevented from using
the system if keys are conflicting.  E.g. if the following was my
org-structure-template-alist, ‘org-insert-structure-template’ would raise
an error.

    (("c"    . "c1")  ; "c[\r\t ]",
     ("co"   . "c2")  ; "co"
     ("com"  . "c3")  ; "cm"
     ("como" . "c4")) ; error as both "co" and "cm" are used

The alternative of dropping duplicates silently or with a warning is worse
IMO.

I have tried to make org-insert-structure-template respect indentation and
insert more space in patch 5.

Patch 6 changes the key binding of blocks to "C-c C-," as discussed in
December 2017.  Let me know if this key is OK and if the old key should
still be kept.

Comments are appreciated as I’d hope to merge them ASAP.

Rasmus

-- 
Slaa Patienten ihjel, saa siger Feberen Pas

Attachment: 0001-org-macs-Move-org-mks-from-org-capture-to-org-macs.patch
Description: Text Data

Attachment: 0002-org-macs-Make-tab-space-and-RET-equivalent-in-org-mk.patch
Description: Text Data

Attachment: 0003-org-org-structure-template-alist-uses-string-keys.patch
Description: Text Data

Attachment: 0004-org-tempo-Various-improvements.patch
Description: Text Data

Attachment: 0005-org-Change-structure-insertion.patch
Description: Text Data

Attachment: 0006-org-Change-org-insert-structure-template-to-C-c-C.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]