dot/emacs: Don't use the `trash' on Emacs 23.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 18 Apr 2020 22:19:20 +0000 (23:19 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 18 Apr 2020 22:19:20 +0000 (23:19 +0100)
It doesn't actually work.  Specifically, if you try to delete a file on,
say, `/tmp', then Emacs tries to rename it and fails with `EXDEV'.

This is especially troublesome because it breaks `emacs --daemon'.
Emacs doesn't usually delete its socket when it quits, so it gets left
behind as `/tmp/mdw/emacs1000/server' or something.  When you run `emacs
--daemon' later, it finds the old socket and tries to delete it, which
fails.  And /then/ you get left with a strange half-daemonized Emacs
which has crashed during startup, and the husk of its parent, and
neither of them can do anything very useful.

dot/emacs

index d918bcd..be0d918 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
       eshell-cmpl-cycle-completions nil)
 (setq dired-deletion-confirmer         ;Make deletion easier in dired
       (symbol-function 'y-or-n-p)
-      delete-by-moving-to-trash t
+      delete-by-moving-to-trash (mdw-emacs-version-p 24)
       dired-listing-switches "-alF"    ;Do `ls -F' things in dired windows
       wdired-allow-to-change-permissions 'advanced)
 (setq read-quoted-char-radix 16)       ;C-q HEX-STUFF [RET]