[Dired] Move ‘dired’ helper functions back into ‘use-package’ declaration

Sorry for the back-and-forth … :/
This commit is contained in:
Daniel Borchmann 2018-01-27 17:58:04 +01:00
parent 7d8abe0e50
commit 5a6e4a81d8
Signed by: exot
GPG Key ID: 4F63DB96D45AA9C6

26
init.el
View File

@ -811,20 +811,16 @@ are assumed to be of the form *.crt."
(dired-quick-sort-setup) (dired-quick-sort-setup)
(bind-key [remap beginning-of-buffer] (bind-key [remap beginning-of-buffer]
#'dired-back-to-top dired-mode-map) 'dired-back-to-top dired-mode-map)
(bind-key [remap end-of-buffer] (bind-key [remap end-of-buffer]
#'dired-jump-to-bottom dired-mode-map) 'dired-jump-to-bottom dired-mode-map)
(bind-key "z" 'dired-get-size dired-mode-map) (bind-key "z" 'dired-get-size dired-mode-map)
(unbind-key "s" dired-mode-map) (unbind-key "s" dired-mode-map)
(unbind-key "<f1>" dired-mode-map) (unbind-key "<f1>" dired-mode-map)
(bind-key "e" #'ora-ediff-files dired-mode-map))) (bind-key "e" 'ora-ediff-files dired-mode-map)
(use-package find-dired ;; https://oremacs.com/2017/03/18/dired-ediff/
:commands (find-dired) (defun ora-ediff-files ()
:config (setq find-ls-option '("-print0 | xargs -0 ls -ld" . "-ld")))
;; https://oremacs.com/2017/03/18/dired-ediff/
(defun ora-ediff-files ()
"Compare marked files in dired with ediff." "Compare marked files in dired with ediff."
(interactive) (interactive)
(lexical-let ((files (dired-get-marked-files)) (lexical-let ((files (dired-get-marked-files))
@ -845,19 +841,19 @@ are assumed to be of the form *.crt."
(set-window-configuration wnd)))) (set-window-configuration wnd))))
(error "No more than 2 files should be marked")))) (error "No more than 2 files should be marked"))))
(defun dired-back-to-top () (defun dired-back-to-top ()
"Jump to first non-trivial line in dired." "Jump to first non-trivial line in dired."
(interactive) (interactive)
(goto-char (point-min)) (goto-char (point-min))
(dired-next-line 2)) (dired-next-line 2))
(defun dired-jump-to-bottom () (defun dired-jump-to-bottom ()
"Jump to last non-trivial line in dired." "Jump to last non-trivial line in dired."
(interactive) (interactive)
(goto-char (point-max)) (goto-char (point-max))
(dired-next-line -1)) (dired-next-line -1))
(defun dired-get-size () ; from emacswiki, via oremacs (defun dired-get-size () ; from emacswiki, via oremacs
"Print size of all files marked in the current dired buffer." "Print size of all files marked in the current dired buffer."
(interactive) (interactive)
(let ((files (dired-get-marked-files))) (let ((files (dired-get-marked-files)))
@ -867,7 +863,11 @@ are assumed to be of the form *.crt."
"size of all marked files: %s" "size of all marked files: %s"
(progn (progn
(re-search-backward "\\(^[0-9.,]+[a-za-z]+\\).*total$") (re-search-backward "\\(^[0-9.,]+[a-za-z]+\\).*total$")
(match-string 1)))))) (match-string 1))))))))
(use-package find-dired
:commands (find-dired)
:config (setq find-ls-option '("-print0 | xargs -0 ls -ld" . "-ld")))
;; * Completion ;; * Completion