10sr преди 6 години
родител
ревизия
9e33558180
Подписан от: 10sr GPG ключ ID: 7BEC428194130EB2
променени са 1 файла, в които са добавени 21 реда и са изтрити 22 реда
  1. +21
    -22
      emacs.el

+ 21
- 22
emacs.el Целия файл

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

;; Time-stamp: <2018-10-10 16:10:35 JST 10sr>
;; Time-stamp: <2018-10-10 18:23:47 JST 10sr>

;;; Code:

@@ -1544,6 +1544,26 @@ ARG is num to show, or defaults to 7."
;; (define-key ctl-x-map "f" 'find-dired)


;; It works!
;; (pop-to-buffer (dired-noselect '("." "shrc" "emacs.el")))

(defun my-dired-git-ls-files (args)
"Dired from git ls-files."
(interactive "sgit ls-files args: ")
(pop-to-buffer-same-window
(dired-noselect `(,default-directory
,@(split-string (shell-command-to-string (concat "git ls-files -z " args))
"\0" t))
""))
)

(define-key ctl-x-map (kbd "f") 'my-dired-git-ls-files)
(with-eval-after-load 'dired
(defvar dired-mode-map (make-sparse-keymap))
(define-key dired-mode-map "f" 'my-dired-git-ls-files))

;; (define-minor-mode my-dired-glob-filter)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; misc funcs

@@ -2217,27 +2237,6 @@ use for the buffer. It defaults to \"*recetf-show*\"."

(define-key ctl-x-map (kbd "C-r") 'recently-show)

;;;;;;;;;;;;;;;;;;;;;;

;; It works!
;; (pop-to-buffer (dired-noselect '("." "shrc" "emacs.el")))

(defun my-dired-git-ls-files (args)
"Dired from git ls-files."
(interactive "sgit ls-files args: ")
(pop-to-buffer-same-window
(dired-noselect `(,default-directory
,@(split-string (shell-command-to-string (concat "git ls-files -z " args))
"\0" t))
""))
)

(define-key ctl-x-map (kbd "f") 'my-dired-git-ls-files)
(with-eval-after-load 'dired
(defvar dired-mode-map (make-sparse-keymap))
(define-key dired-mode-map "f" 'my-dired-git-ls-files))

;; (define-minor-mode my-dired-glob-filter)

;; Local Variables:
;; flycheck-disabled-checkers: (emacs-lisp-checkdoc)


Зареждане…
Отказ
Запис