Skip to content

Commit 83f8a71

Browse files
committed
Add my-org-insert-structure-template
At the time of writing, the Gitea org mode parser cannot handle lower case org-mode structure blocks, which breaks display of org files in the web interface. Should be fixed when issue go-gitea/gitea#5710 is resolved. As a workaround, simply make sure the structure blocks are upper case (which they used to be before org-mode 9.2).
1 parent baf5dc2 commit 83f8a71

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

configuration.org

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ keeping track of time spent at work.
830830
("C-c t" . my-org-todo-list)
831831
:map org-mode-map
832832
("C-c '" . my-org-edit-special)
833+
([remap org-insert-structure-template] . my-org-insert-structure-template)
833834
("M-p" . org-previous-visible-heading)
834835
("M-n" . org-next-visible-heading))
835836

@@ -882,6 +883,15 @@ keeping track of time spent at work.
882883

883884
(evil-define-key 'insert org-mode-map [tab] 'org-cycle)
884885

886+
(defun my-org-insert-structure-template ()
887+
"Like `org-insert-structure-template', but upcase all org block structures in current buffer."
888+
(interactive)
889+
(call-interactively #'org-insert-structure-template)
890+
(save-excursion
891+
(goto-char (point-min))
892+
(while (re-search-forward "#\\+\\(begin\\|end\\)_[[:alnum:]]+" nil t)
893+
(replace-match (upcase (match-string 0))))))
894+
885895
(defun my-org-todo-list ()
886896
"Show org-todo-list with \"IN PROGRESS\" keyword selected."
887897
(interactive)

0 commit comments

Comments
 (0)