Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org-brain-remove-child function paren imbalance #364

Open
vigilancetech-com opened this issue Jun 21, 2021 · 1 comment
Open

org-brain-remove-child function paren imbalance #364

vigilancetech-com opened this issue Jun 21, 2021 · 1 comment

Comments

@vigilancetech-com
Copy link

the last 4 (or 5) lines of the function don't appear to be part of the function [possibly due to the two parens at the end of the line that goes "(org-brain-remove-relationship entry child))"]

I'd fix it but I'm not exactly sure what the logic was supposed to be and am too jammed up right now to look at it.

@Kungsgeten
Copy link
Owner

Hi! I don't see any imbalance:

(defun org-brain-remove-child (entry child &optional verbose)
  "Remove CHILD from ENTRY.
If called interactively use `org-brain-entry-at-point' and prompt for CHILD.
Using `\\[universal-argument]' will use `org-brain-button-at-point' as ENTRY.
If VERBOSE is non-nil then display a message."
  (interactive (let ((e (if current-prefix-arg
                            (car (org-brain-button-at-point))
                          (org-brain-entry-at-pt))))
                 (list e (org-brain-choose-entry "Remove child: "
                                                 (org-brain-children e)
                                                 nil t)
                       t)))
  (if (member child (org-brain-local-children entry))
      (if (and (> (length (org-brain-parents child)) 1)
               (y-or-n-p
                (format "%s is %s's local parent. Would you like to change the local parent of %s? "
                        (org-brain-title entry) (org-brain-title child) (org-brain-title child))))
          (let* ((linked-parents (org-brain--linked-property-entries child org-brain-parents-property-name))
                 (new-parent (if (equal 1 (length linked-parents))
                                 (car-safe linked-parents)
                               (org-brain-choose-entry "Refile to parent: " linked-parents))))
            (org-brain-remove-relationship entry (org-brain-change-local-parent child new-parent)))
        (org-brain-delete-entry child))
    (org-brain-remove-relationship entry child))
  (if verbose (message "'%s' is no longer a child of '%s'."
                       (org-brain-entry-name child)
                       (org-brain-entry-name entry)))
  (org-brain--revert-if-visualizing))

Are you sure you haven't made changes to your local branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants