*** magit.el.orig 2015-01-09 00:05:47.223500400 +0900 --- magit.el 2015-01-09 00:44:07.918092600 +0900 *************** *** 93,99 **** (require 'ediff) (require 'eshell) (require 'ido) ! (require 'iswitchb) (require 'package nil t) (require 'view)) --- 93,99 ---- (require 'ediff) (require 'eshell) (require 'ido) ! ; (require 'iswitchb) (require 'package nil t) (require 'view)) *************** *** 108,114 **** (declare-function ediff-cleanup-mess 'ediff) (declare-function eshell-parse-arguments 'eshell) (declare-function ido-completing-read 'ido) ! (declare-function iswitchb-read-buffer 'iswitchb) (declare-function package-desc-vers 'package) (declare-function package-desc-version 'package) (declare-function package-version-join 'package) --- 108,114 ---- (declare-function ediff-cleanup-mess 'ediff) (declare-function eshell-parse-arguments 'eshell) (declare-function ido-completing-read 'ido) ! ;(declare-function iswitchb-read-buffer 'iswitchb) (declare-function package-desc-vers 'package) (declare-function package-desc-version 'package) (declare-function package-version-join 'package) *************** *** 637,643 **** (defcustom magit-completing-read-function 'magit-builtin-completing-read "Function to be called when requesting input from the user." :group 'magit ! :type '(radio (function-item magit-iswitchb-completing-read) (function-item magit-ido-completing-read) (function-item magit-builtin-completing-read) (function :tag "Other"))) --- 637,643 ---- (defcustom magit-completing-read-function 'magit-builtin-completing-read "Function to be called when requesting input from the user." :group 'magit ! :type '(radio ;(function-item magit-iswitchb-completing-read) (function-item magit-ido-completing-read) (function-item magit-builtin-completing-read) (function :tag "Other"))) *************** *** 777,783 **** magit-insert-unstaged-changes magit-insert-staged-changes magit-insert-unpulled-commits ! magit-insert-unpushed-commits) "Hook run to insert sections into the status buffer. This option allows reordering the sections and adding sections --- 777,785 ---- magit-insert-unstaged-changes magit-insert-staged-changes magit-insert-unpulled-commits ! magit-insert-unpushed-commits ! magit-insert-cached-files ! ) "Hook run to insert sections into the status buffer. This option allows reordering the sections and adding sections *************** *** 1792,1807 **** ;;; Utilities (1) ;;;; Minibuffer Input ! (defun magit-iswitchb-completing-read ! (prompt choices &optional predicate require-match initial-input hist def) ! "iswitchb-based completing-read almost-replacement." ! (require 'iswitchb) ! (let ((iswitchb-make-buflist-hook ! (lambda () ! (setq iswitchb-temp-buflist (if (consp (car choices)) ! (mapcar #'car choices) ! choices))))) ! (iswitchb-read-buffer prompt (or initial-input def) require-match))) (defun magit-ido-completing-read (prompt choices &optional predicate require-match initial-input hist def) --- 1794,1809 ---- ;;; Utilities (1) ;;;; Minibuffer Input ! ;(defun magit-iswitchb-completing-read ! ; (prompt choices &optional predicate require-match initial-input hist def) ! ; "iswitchb-based completing-read almost-replacement." ! ; (require 'iswitchb) ! ; (let ((iswitchb-make-buflist-hook ! ; (lambda () ! ; (setq iswitchb-temp-buflist (if (consp (car choices)) ! ; (mapcar #'car choices) ! ; choices))))) ! ; (iswitchb-read-buffer prompt (or initial-input def) require-match))) (defun magit-ido-completing-read (prompt choices &optional predicate require-match initial-input hist def) *************** *** 2807,2812 **** --- 2809,2815 ---- (magit-define-section-jumper stashes "Stashes") (magit-define-section-jumper untracked "Untracked files") + (magit-define-section-jumper cached "Cached files") (magit-define-section-jumper unstaged "Unstaged changes") (magit-define-section-jumper staged "Staged changes") (magit-define-section-jumper unpulled "Unpulled commits") *************** *** 4423,4428 **** --- 4426,4448 ---- (insert "\t" file "\n"))) (insert "\n"))))) + (defun magit-insert-cached-files () + (magit-with-section (section cached 'cached "Cached files:" t) + (let ((files (cl-mapcan + (lambda (f) + (when (eq (aref f 0) (aref "H" 0)) (list f))) + (magit-git-lines + "ls-files" "-t" + (concat "" (magit-get "status.showCachedFiles")))))) + (if (not files) + (setq section nil) + (dolist (file files) + (setq file (magit-decode-git-path (substring file 2))) + (magit-with-section (section file file) + (setf (magit-section-info section) file) + (insert "\t" file "\n"))) + (insert "\n"))))) + (defun magit-insert-pending-commits () (let* ((info (magit-read-rewrite-info)) (pending (cdr (assq 'pending info)))) *************** *** 5038,5043 **** --- 5058,5064 ---- (magit-section-action visit (info parent-info) ((diff diffstat [file untracked]) (magit-visit-file-item info other-window)) + ([file cached] (magit-visit-file-item info other-window)) (hunk (magit-visit-file-item parent-info other-window (magit-hunk-item-target-line it) (current-column))) *************** *** 5094,5099 **** --- 5115,5121 ---- (file-truename (magit-section-action dired-jump (info parent-info) ([file untracked] info) + ([file cached] info) ((diff diffstat) info) (hunk parent-info) (t default-directory)))))