feat(macos): osx-trash is only needed by emacs < 29

This commit is contained in:
Sean Farley 2023-11-29 12:32:20 -08:00 committed by Henrik Lissner
parent c20c2aa36e
commit 85ce866953
2 changed files with 9 additions and 5 deletions

View file

@ -33,17 +33,20 @@
(after! auth-source (after! auth-source
(pushnew! auth-sources 'macos-keychain-internet 'macos-keychain-generic)) (pushnew! auth-sources 'macos-keychain-internet 'macos-keychain-generic))
;; Delete files to trash on macOS, as an extra layer of precaution against
;; accidentally deleting wanted files.
(setq delete-by-moving-to-trash t)
;; ;;
;;; Packages ;;; Packages
(use-package! osx-trash (use-package! osx-trash
;; DEPRECATED: Not needed on Emacs 29+. Remove when dropping 28 support.
;; Fixed by https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21340.
:when (< emacs-major-version 29)
:commands osx-trash-move-file-to-trash :commands osx-trash-move-file-to-trash
:init :init
;; Delete files to trash on macOS, as an extra layer of precaution against
;; accidentally deleting wanted files.
(setq delete-by-moving-to-trash t)
;; Lazy load `osx-trash' ;; Lazy load `osx-trash'
(when (not (fboundp 'system-move-file-to-trash)) (when (not (fboundp 'system-move-file-to-trash))
(defun system-move-file-to-trash (file) (defun system-move-file-to-trash (file)

View file

@ -1,5 +1,6 @@
;; -*- no-byte-compile: t; -*- ;; -*- no-byte-compile: t; -*-
;;; os/macos/packages.el ;;; os/macos/packages.el
(package! osx-trash :pin "90f0c99206022fec646206018fcd63d9d2e57325") (when (< emacs-major-version 29)
(package! osx-trash :pin "90f0c99206022fec646206018fcd63d9d2e57325"))
(package! ns-auto-titlebar :pin "60273e764bf8d95abc40dd2fdc23af87ea9ee33b") (package! ns-auto-titlebar :pin "60273e764bf8d95abc40dd2fdc23af87ea9ee33b")