diff --git a/README.org b/README.org index 17d7cbb..ea86505 100644 --- a/README.org +++ b/README.org @@ -822,7 +822,8 @@ by means of the facilities of [[info:emacs#Dired][dired (info)]] as follows: Listing [[lst:setup-dired]] makes the directory editor group the directories in front of the files and sort each group alphabetically. It also adds a key -binding to =dired-mode-map= to open files with the [[https://en.wikipedia.org/wiki/Eww_(web_browser)][Emacs Web Wowser]]. +binding to =dired-mode-map= to open files with the [[https://en.wikipedia.org/wiki/Eww_(web_browser)][Emacs Web Wowser]]. Listing +[[lst:wrap-dired]] wraps =dired= to sort the directory entries in different ways. #+caption[Setup =dired=]: #+caption: Setup =dired=. @@ -854,6 +855,23 @@ binding to =dired-mode-map= to open files with the [[https://en.wikipedia.org/wi (setopt wdired-allow-to-change-permissions t)) #+end_src +#+caption[Wrap =dired=]: +#+caption: Wrap =dired=. +#+name: lst:wrap-dired +#+begin_src emacs-lisp -n :results silent +(defun dired-by-newest () + "Wrap dired to sort directory entries by newest first." + (interactive) + (when-let ((dir (read-directory-name "Dired-by-newest (directory): "))) + (dired dir "-alt"))) + +(defun dired-by-oldest () + "Wrap dired to sort directory entries by oldest first." + (interactive) + (when-let ((dir (read-directory-name "Dired-by-oldest (directory): "))) + (dired dir "-altr"))) +#+end_src + * [[info:emacs#Minibuffer][Minibuffer (info)]] :PROPERTIES: :CUSTOM_ID: sec:minibuffer-completion-styles