doesn't work just yet
Links
| (defun org-smart-meta-return (&optional ignore) | |
| "Add new list item, heading or table row with RET." | |
| (interactive "P") | |
| (if ignore | |
| (org-meta-return) | |
| (cond | |
| ;; checkboxes | |
| ((org-at-item-checkbox-p) | |
| (org-insert-todo-heading nil)) | |
| ;; lists end with two blank lines, so we need to make sure we are also not | |
| ;; at the beginning of a line to avoid a loop where a new entry gets | |
| ;; created with only one blank line. | |
| ((org-in-item-p) | |
| (if (save-excursion (beginning-of-line) (org-element-property :contents-begin (org-element-context))) | |
| (org-insert-heading) | |
| (beginning-of-line) | |
| (delete-region (line-beginning-position) (line-end-position)) | |
| (org-meta-return))) | |
| ;; fall-through case | |
| (t | |
| (org-meta-return))))) |