From bd8c21114d67799147012219f42a8a12201f3623 Mon Sep 17 00:00:00 2001 From: Karl Voit Date: Sat, 30 Jun 2018 00:04:48 +0200 Subject: [PATCH] README: integration into Dired --- Integration.org | 31 +++++++++++++++++++++++++++++++ README.org | 1 + 2 files changed, 32 insertions(+) diff --git a/Integration.org b/Integration.org index f69c12c..d59fa77 100644 --- a/Integration.org +++ b/Integration.org @@ -283,3 +283,34 @@ If you want to assign a different keyboard shortcut than =Ctrl-1= like - If your shortcut is taken, you'll get a notification. Don't overwrite essential shortcuts you're using. - OK + +** Integration into Dired +:PROPERTIES: +:CREATED: [2018-06-30 Sat 00:00] +:END: + +[[https://en.wikipedia.org/wiki/Dired][Dired]] is the oldest file manager. It started in 1974 and offers a wide +range of efficient functionality. Here, we add filetags to Dired. + +#+BEGIN_SRC emacs-lisp +(defun my-dired-filetags () + "Run \"filetags\" on current or marked files" + (interactive) + (let* ((marked-files (f-uniquify (dired-get-marked-files)))) ;; apply to single file or marked files + (when (my-system-type-is-windows) + (dired-do-shell-command "wrapper-script-for-filetags.bat *" nil marked-files) + ) + (when (my-system-type-is-gnu) + ;; --disable-server → provides a blocking terminal window (instead of a non-blocking one which swallows the revert-buffer afterward) + (dired-do-shell-command "xfce4-terminal --disable-server --geometry=100x20+330+5 --hide-menubar -x /home/vk/bin/filetags --interactive *" nil marked-files) + ) + ) + (revert-buffer nil t t) ;; refresh listing of files + ) +#+END_SRC + +I mapped it to =M-t= in my dired buffers: + +#+BEGIN_SRC emacs-lisp +(define-key dired-mode-map (kbd "M-t") 'my-dired-filetags) +#+END_SRC diff --git a/README.org b/README.org index e71254a..af98e67 100644 --- a/README.org +++ b/README.org @@ -466,6 +466,7 @@ external commands being added: - [[https://en.wikipedia.org/wiki/Thunar][Thunar]] is a popular GNU/Linux file browser for the xfce environment - Windows Explorer - [[http://freecommander.com/en/summary/][FreeCommander]], my recommendated alternative to Windows explorer +- [[https://en.wikipedia.org/wiki/Dired][Dired]], the GNU/Emacs file manager If you have integrated filetags in additional commonly used tools, please send me a short how-to so that others are able to get the most