File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 303303 (mermaid . t)
304304 (sql . t)
305305 (shell . t)))
306+
307+ ;; Check for org mode and existence of buffer
308+ (defun f-ediff-org-showhide (buf command &rest cmdargs)
309+ "If buffer exists and is orgmode then execute command"
310+ (when buf
311+ (when (eq (buffer-local-value 'major-mode (get-buffer buf)) 'org-mode)
312+ (save-excursion (set-buffer buf) (apply command cmdargs)))))
313+
314+ (defun f-ediff-org-unfold-tree-element ()
315+ "Unfold tree at diff location"
316+ (f-ediff-org-showhide ediff-buffer-A 'org-reveal)
317+ (f-ediff-org-showhide ediff-buffer-B 'org-reveal)
318+ (f-ediff-org-showhide ediff-buffer-C 'org-reveal))
319+
320+ (defun f-ediff-org-fold-tree ()
321+ "Fold tree back to top level"
322+ (f-ediff-org-showhide ediff-buffer-A 'hide-sublevels 1)
323+ (f-ediff-org-showhide ediff-buffer-B 'hide-sublevels 1)
324+ (f-ediff-org-showhide ediff-buffer-C 'hide-sublevels 1))
325+
326+ (add-hook 'ediff-select-hook 'f-ediff-org-unfold-tree-element)
327+ (add-hook 'ediff-unselect-hook 'f-ediff-org-fold-tree)
306328 '' ;
307329 # bindLocal = {
308330 # org-mode-map = {
You can’t perform that action at this time.
0 commit comments