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 --- init.el | 9 +++++---- lisp/acdw-org.el | 13 ++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/init.el b/init.el index 6f97e02..d3a4111 100644 --- a/init.el +++ b/init.el @@ -375,7 +375,7 @@ (setup (:straight (org :host nil :repo "https://code.orgmode.org/bzg/org-mode.git")) - (require 'acdw-org) + (require 'acdw-org) ; so I don't clutter up init.el (:option org-adapt-indentation nil org-catch-invisible-edits 'smart org-confirm-babel-evaluate nil @@ -400,10 +400,11 @@ org-startup-truncated nil org-tags-column (- 0 fill-column -3) org-directory "~/org") - (:bind "RET" unpackaged/org-return-dwim + (:bind "RET" acdw-org/return-dwim "" acdw-org/org-table-copy-down) - (add-hook 'before-save-hook #'acdw/hook--org-mode-fix-blank-lines) - (advice-add 'org-delete-backward-char :override #'acdw-org/delete-backward-char)) + (add-hook 'before-save-hook #'acdw-org/fix-blank-lines-in-buffer) + (advice-add 'org-delete-backward-char + :override #'acdw-org/delete-backward-char)) (setup eshell (:option eshell-directory-name (acdw/dir "eshell/" t) 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