Browse Source

Add some variables

master
10sr 6 years ago
parent
commit
666477984f
Signed by: 10sr GPG Key ID: C384BB17CBB19347
1 changed files with 14 additions and 2 deletions
  1. +14
    -2
      emacs.el

+ 14
- 2
emacs.el View File

@@ -1,6 +1,6 @@
;;; emacs.el --- 10sr emacs initialization ;;; emacs.el --- 10sr emacs initialization


;; Time-stamp: <2018-10-12 21:23:22 JST 10sr>
;; Time-stamp: <2018-10-12 21:29:13 JST 10sr>


;;; Code: ;;; Code:


@@ -2254,6 +2254,14 @@ use for the buffer. It defaults to \"*recetf-show*\"."
"Path name currently visiting without leading slash.") "Path name currently visiting without leading slash.")
(make-variable-buffer-local 'git-walktree-current-path) (make-variable-buffer-local 'git-walktree-current-path)


(defvar git-walktree-buffer-file-name nil
"Psudo filename of current buffer.")
(make-variable-buffer-local 'git-walktree-buffer-file-name)

(defvar git-walktree-object-id nil
"Object id of current buffer.")
(make-variable-buffer-local 'git-walktree-object-id)

(defun git-walktree--create-buffer (commitish name) (defun git-walktree--create-buffer (commitish name)
;; TODO: check repository ;; TODO: check repository
"Create and return buffer for NAME." "Create and return buffer for NAME."
@@ -2310,6 +2318,7 @@ use for the buffer. It defaults to \"*recetf-show*\"."


(setq git-walktree-current-commitish commitish) (setq git-walktree-current-commitish commitish)
(setq git-walktree-current-path path) (setq git-walktree-current-path path)
(setq git-walktree-object-id treeish)
;; FIXME: Somehow point go back to point-min when reopen the buffer ;; FIXME: Somehow point go back to point-min when reopen the buffer
(if (eq point (point-min)) (if (eq point (point-min))
(goto-char point-tree-start) (goto-char point-tree-start)
@@ -2349,13 +2358,15 @@ Result will be inserted into current buffer."
"cat-file" "cat-file"
"-p" "-p"
blob)) blob))
(setq buffer-file-name
(setq git-walktree-buffer-file-name
(concat (git-walktree--git-plumbing "rev-parse" (concat (git-walktree--git-plumbing "rev-parse"
"--show-toplevel") "--show-toplevel")
"/git@" "/git@"
commitish commitish
":" ":"
path)) path))
(setq buffer-file-name
git-walktree-buffer-file-name)
(normal-mode t) (normal-mode t)
;; For asking filename when C-xC-s ;; For asking filename when C-xC-s
(setq buffer-file-name nil) (setq buffer-file-name nil)
@@ -2363,6 +2374,7 @@ Result will be inserted into current buffer."


(setq git-walktree-current-commitish commitish) (setq git-walktree-current-commitish commitish)
(setq git-walktree-current-path path) (setq git-walktree-current-path path)
(setq git-walktree-object-id blob)
(setq buffer-read-only t) (setq buffer-read-only t)
(goto-char point) (goto-char point)
) )


Loading…
Cancel
Save