From 76a737cec6589584fdd2e3c1931685f567e2dfb2 Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Thu, 18 Oct 2018 14:42:30 +0900 Subject: [PATCH] Add func --- emacs.el | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/emacs.el b/emacs.el index 4e14e65..b6b440d 100644 --- a/emacs.el +++ b/emacs.el @@ -1,6 +1,6 @@ ;;; emacs.el --- 10sr emacs initialization -;; Time-stamp: <2018-10-18 14:29:22 JST 10sr> +;; Time-stamp: <2018-10-18 14:42:27 JST 10sr> ;;; Code: @@ -2290,7 +2290,6 @@ use for the buffer. It defaults to \"*recetf-show*\"." (defun git-walktree--create-buffer (commitish name type) "Create and return buffer for COMMITISH:NAME. TYPE is target object type." - ;; TODO: Give buffer name as an argument (let* ((root (git-walktree--git-plumbing "rev-parse" "--show-toplevel")) (commitish-display (git-walktree--commitish-fordisplay commitish)) @@ -2457,6 +2456,18 @@ Result will be inserted into current buffer." )) buf)) +(defun git-walktree--open-noselect-until-found (commitish &optional path) + "Open git object of COMMITISH:PATH. +If PATH not found in COMMITISH tree, go up directory and try again. +When PATH is omitted or nil, it is calculated from current file or directory." + (cl-assert commitish) + (let ((type (git-walktree--git-plumbing "cat-file" + "-t" + commitish))) + (cl-assert (string= type "commit"))) + ;; TODO: implement + nil) + ;; TODO: Store view history ;; TODO: Open current file or directory if available (defun git-walktree--open-noselect (commitish path object)