Skip to content

Commit

Permalink
Add my-org-insert-structure-template
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
matthijsk committed Aug 10, 2019
1 parent baf5dc2 commit 83f8a71
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions configuration.org
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ keeping track of time spent at work.
("C-c t" . my-org-todo-list)
:map org-mode-map
("C-c '" . my-org-edit-special)
([remap org-insert-structure-template] . my-org-insert-structure-template)
("M-p" . org-previous-visible-heading)
("M-n" . org-next-visible-heading))

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

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

(defun my-org-insert-structure-template ()
"Like `org-insert-structure-template', but upcase all org block structures in current buffer."
(interactive)
(call-interactively #'org-insert-structure-template)
(save-excursion
(goto-char (point-min))
(while (re-search-forward "#\\+\\(begin\\|end\\)_[[:alnum:]]+" nil t)
(replace-match (upcase (match-string 0))))))

(defun my-org-todo-list ()
"Show org-todo-list with \"IN PROGRESS\" keyword selected."
(interactive)
Expand Down

0 comments on commit 83f8a71

Please sign in to comment.