From 780f58dece83b7fe3507c54faec672a108efd863 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 19 Apr 2021 16:16:46 -0500 Subject: Rename functions in acdw-org.el --- lisp/acdw-org.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 46497f6..dfabcc7 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el @@ -20,7 +20,7 @@ ;;; unpackaged.el: https://github.com/alphapapa/unpackaged.el -(defun unpackaged/org-element-descendant-of (type element) +(defun acdw-org/element-descendant-of (type element) "Return non-nil if ELEMENT is a descendant of TYPE. TYPE should be an element type, like `item' or `paragraph'. ELEMENT should be a list like that returned by `org-element-context'." @@ -29,8 +29,7 @@ ELEMENT should be a list like that returned by `org-element-context'." (or (eq type (car parent)) (unpackaged/org-element-descendant-of type parent)))) -;;;###autoload -(defun unpackaged/org-return-dwim (&optional default) +(defun acdw-org/return-dwim (&optional default) "A helpful replacement for `org-return'. With prefix, call `org-return'. On headings, move point to position after entry content. In @@ -92,7 +91,7 @@ appropriate. In tables, insert a new row or end the table." (emptyp (eq (org-element-property :contents-begin context) (org-element-property :contents-end context))) (item-child-p - (unpackaged/org-element-descendant-of 'item context))) + (acdw-org/element-descendant-of 'item context))) ;; The original function from unpackaged just tested the (or ...) test ;; in this cond, in an if. However, that doesn't auto-end nested ;; lists. So I made this form a cond and added the (and...) test in @@ -133,7 +132,7 @@ appropriate. In tables, insert a new row or end the table." ;; All other cases: call `org-return'. (org-return))))) -(defun unpackaged/org-fix-blank-lines (&optional prefix) +(defun acdw-org/fix-blank-lines (&optional prefix) "Ensure that blank lines exist between headings and between headings and their contents. With prefix, operate on whole buffer. Ensures that blank lines exist after each @@ -171,10 +170,10 @@ appropriate. In tables, insert a new row or end the table." nil 'tree))) -(defun acdw/hook--org-mode-fix-blank-lines () +(defun acdw-org/fix-blanks-in-buffer () (when (eq major-mode 'org-mode) (let ((current-prefix-arg 4)) - (call-interactively #'unpackaged/org-fix-blank-lines)))) + (call-interactively #'acdw-org/fix-blank-lines)))) ;;; Generate custom IDs: -- cgit 1.4.1-21-gabe81