Function: ediff-toggle-show-ancestor

ediff-toggle-show-ancestor is an interactive and byte-compiled function defined in ediff-util.el.gz.

Signature

(ediff-toggle-show-ancestor)

Documentation

Toggle to show/hide the ancestor buffer.

Probably introduced at or before Emacs version 26.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/ediff-util.el.gz
(defun ediff-toggle-show-ancestor ()
  "Toggle to show/hide the ancestor buffer."
  (interactive)
  (ediff--check-ancestor-exists)
  ;; Save original value if not yet, and add hook to restore it on exit.
  (unless ediff--show-ancestor-orig
    (setq ediff--show-ancestor-orig ediff-show-ancestor)
    (add-hook 'ediff-quit-hook #'ediff--restore-options-on-exit))
  (setq ediff-show-ancestor (not ediff-show-ancestor))
  ;; If equal than orig, then nothing to restore on exit.
  (when (eq ediff-show-ancestor ediff--show-ancestor-orig)
    (setq ediff--show-ancestor-orig nil)
    (remove-hook 'ediff-quit-hook #'ediff--restore-options-on-exit))
  (if (not ediff-show-ancestor)
      (progn
        (delete-window ediff-window-Ancestor)
        (ediff-recenter)
        (message "Ancestor buffer is hidden"))
    (let ((wind
           (ediff-get-visible-buffer-window ediff-ancestor-buffer)))
      (when wind (raise-frame (window-frame wind))))
    (ediff-recenter)
    (message "Showing ancestor buffer")))