Closed tumashu closed 4 years ago
Hi! I like the idea! However I wonder if this shouldn't be the default of org-brain--revert-if-visualizing
? I made a version like this, which seems to work:
(defun org-brain--revert-if-visualizing ()
"Revert buffer if in `org-brain-visualize-mode'."
(when (eq major-mode 'org-brain-visualize-mode)
(let ((button-entry-id (org-brain-entry-identifier
(car (org-brain-button-at-point)))))
(org-brain-stop-wandering)
(revert-buffer)
(when button-entry-id
(let ((char-target (point)))
(goto-char (point-min))
(search-forward "\n\n" nil t)
(while (and (or (ignore-errors (forward-button 1))
(goto-char char-target))
(not (equal (button-get (button-at (point)) 'id)
button-entry-id)))))))))
Maybe its nice to have the goto entry button as a function though.
good idea too :-)
I made some modifications to the code above and commited it. I hope you don't mind. Thank you for the suggestion!
:-) no problem, just just it.
At 2020-02-29 18:55:44, "Erik Sjöstrand" notifications@github.com wrote:
I made some modifications to the code above and commited it. I hope you don't mind. Thank you for the suggestion!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.