From bdc3969b723efdf9baad34e22f3f90702352a0a5 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 22 Jun 2023 09:56:52 +1000 Subject: minor change in my-dired and ycp-org --- emacs/.emacs.d/init/ycp-org.el | 2 +- emacs/.emacs.d/lisp/my/my-dired.el | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'emacs') diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el index 20817ac..93d192f 100644 --- a/emacs/.emacs.d/init/ycp-org.el +++ b/emacs/.emacs.d/init/ycp-org.el @@ -37,7 +37,7 @@ (setq org-adapt-indentation 'headline-data) (setq org-special-ctrl-a/e t) (setq org-special-ctrl-k t) - (setq org-M-RET-may-split-line '((default . nil))) + (setq org-M-RET-may-split-line '((default . t))) (setq org-catch-invisible-edits 'show) (setq org-modules '(ol-bbdb ol-gnus ol-info)) (setq org-use-sub-superscripts '{}) diff --git a/emacs/.emacs.d/lisp/my/my-dired.el b/emacs/.emacs.d/lisp/my/my-dired.el index 21240e1..a2485ab 100644 --- a/emacs/.emacs.d/lisp/my/my-dired.el +++ b/emacs/.emacs.d/lisp/my/my-dired.el @@ -105,5 +105,27 @@ With a prefix arg, toggle `my-dired-reverse-sorting' instead." ((equal mode-name "Dired by extension") (my-dired-sort-by-name))))) +(defun my-empty-xdg-trash () + "Empty the xdg trash" + (interactive) + (let* ((xdg-data-dir + (directory-file-name + (expand-file-name "Trash" + (or (getenv "XDG_DATA_HOME") + "~/.local/share")))) + (trash-files-dir (expand-file-name "files" xdg-data-dir)) + (trash-info-dir (expand-file-name "info" xdg-data-dir))) + (delete-directory trash-files-dir t) + (delete-directory trash-info-dir t))) + +(defun my-dired-do-delete (&arg) + "Trash or (with a prefix arg) delete files." + (interactive "P") + (if arg + (let ((delete-by-moving-to-trash nil)) + (call-interactively 'dired-do-delete)) + (call-interactively 'dired-do-delete)) + ) + (provide 'my-dired) ;;; my-dired.el ends here -- cgit v1.2.3