aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2023-06-22 09:56:52 +1000
committerYuchen Pei <id@ypei.org>2023-06-22 09:56:52 +1000
commitbdc3969b723efdf9baad34e22f3f90702352a0a5 (patch)
tree7e6431a7574e3ac4f3458f4994c079709c3233ed /emacs
parent045db0ffe9908cf973a1c8636120b5ab9023299c (diff)
minor change in my-dired and ycp-org
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init/ycp-org.el2
-rw-r--r--emacs/.emacs.d/lisp/my/my-dired.el22
2 files changed, 23 insertions, 1 deletions
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