Pārlūkot izejas kodu

Move function

master
10sr pirms 6 gadiem
vecāks
revīzija
9e33558180
Parakstījis: 10sr GPG atslēgas ID: 7BEC428194130EB2
1 mainītis faili ar 21 papildinājumiem un 22 dzēšanām
  1. +21
    -22
      emacs.el

+ 21
- 22
emacs.el Parādīt failu

@@ -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)


Notiek ielāde…
Atcelt
Saglabāt