diff options
-rw-r--r-- | config.org | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/config.org b/config.org index b823368..4c8f3d5 100644 --- a/config.org +++ b/config.org | |||
@@ -1775,19 +1775,20 @@ I want to use the newest version of Org that I can. | |||
1775 | On headings, move point to position after entry content. In | 1775 | On headings, move point to position after entry content. In |
1776 | lists, insert a new item or end the list, with checkbox if | 1776 | lists, insert a new item or end the list, with checkbox if |
1777 | appropriate. In tables, insert a new row or end the table." | 1777 | appropriate. In tables, insert a new row or end the table." |
1778 | ;; Inspired by John Kitchin: http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/ | 1778 | ;; Inspired by John Kitchin: |
1779 | ;; http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/ | ||
1779 | (interactive "P") | 1780 | (interactive "P") |
1780 | (if default | 1781 | (if default |
1781 | (org-return) | 1782 | (org-return) |
1782 | (cond | 1783 | (cond |
1783 | ;; Act depending on context around point. | 1784 | ;; Act depending on context around point. |
1784 | 1785 | ||
1785 | ;; NOTE: I prefer RET to not follow links, but by uncommenting this block, links will be | 1786 | ;; NOTE: I prefer RET to not follow links, but by uncommenting |
1786 | ;; followed. | 1787 | ;; this block, links will be followed. |
1787 | 1788 | ||
1788 | ;; ((eq 'link (car (org-element-context))) | 1789 | ((eq 'link (car (org-element-context))) |
1789 | ;; ;; Link: Open it. | 1790 | ;; Link: Open it. |
1790 | ;; (org-open-at-point-global)) | 1791 | (org-open-at-point-global)) |
1791 | 1792 | ||
1792 | ((org-at-heading-p) | 1793 | ((org-at-heading-p) |
1793 | ;; Heading: Move to position after entry content. | 1794 | ;; Heading: Move to position after entry content. |
@@ -1808,8 +1809,13 @@ I want to use the newest version of Org that I can. | |||
1808 | (forward-line) | 1809 | (forward-line) |
1809 | (insert "\n") | 1810 | (insert "\n") |
1810 | (forward-line -1)) | 1811 | (forward-line -1)) |
1811 | ;; FIXME: looking-back is supposed to be called with more arguments. | 1812 | ;; FIXME: looking-back is supposed to be called with |
1812 | (while (not (looking-back (rx (repeat 3 (seq (optional blank) "\n"))) nil)) | 1813 | ;; more arguments. |
1814 | (while (not (looking-back (rx | ||
1815 | (repeat 3 | ||
1816 | (seq (optional blank) | ||
1817 | "\n"))) | ||
1818 | nil)) | ||
1813 | (insert "\n")) | 1819 | (insert "\n")) |
1814 | (forward-line -1))))) | 1820 | (forward-line -1))))) |
1815 | 1821 | ||
@@ -1824,11 +1830,13 @@ I want to use the newest version of Org that I can. | |||
1824 | (and (eq 'item (car context)) | 1830 | (and (eq 'item (car context)) |
1825 | (not (eq (org-element-property :contents-begin context) | 1831 | (not (eq (org-element-property :contents-begin context) |
1826 | (org-element-property :contents-end context)))) | 1832 | (org-element-property :contents-end context)))) |
1827 | (unpackaged/org-element-descendant-of 'item context)) ; Element in list item, e.g. a link | 1833 | ;; Element in list item, e.g. a link |
1834 | (unpackaged/org-element-descendant-of 'item context)) | ||
1828 | ;; Non-empty item: Add new item. | 1835 | ;; Non-empty item: Add new item. |
1829 | (org-insert-item) | 1836 | (org-insert-item) |
1830 | ;; Empty item: Close the list. | 1837 | ;; Empty item: Close the list. |
1831 | ;; TODO: Do this with org functions rather than operating on the text. Can't seem to find the right function. | 1838 | ;; TODO: Do this with org functions rather than operating |
1839 | ;; on the text. Can't seem to find the right function. | ||
1832 | (delete-region (line-beginning-position) (line-end-position)) | 1840 | (delete-region (line-beginning-position) (line-end-position)) |
1833 | (insert "\n")))) | 1841 | (insert "\n")))) |
1834 | 1842 | ||