all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* trashback
@ 2006-02-06  0:03 BRUCE INGALLS
  2006-02-06 12:10 ` trashback Xavier Maillard
  2006-02-06 16:20 ` trashback Xavier Maillard
  0 siblings, 2 replies; 3+ messages in thread
From: BRUCE INGALLS @ 2006-02-06  0:03 UTC (permalink / raw)


It seems to me, that a good place to put emacs backups, is in your
Wastebasket directory, and let your Operating or Desktop System deal
with cleanup.
Frankly, if I need a backup for more than an hour, I'd turn to an
industrial strength system, such as Arch, Subversion, CVS or RCS.

The attached code had some testing on w32. I'm sure most of the other
directories are wrong. However, it should not require much work to be
useful. I do need some porting & testing help, however. I expect that
EmacsWiki is a good home, with an announcement on gnu.emacs.sources.
Perhaps the maintainer of backup-dir.el (or ebackup.el) would be
interested in adding this code, to make it the M-x customize default?

;;--- cut here ---

;;trashback.el: auto discovers local OS dependent waste-basket dir, to
;;consolidate & manage all your ~ backup files.

;;Version 2006-2-5 is a poorly tested pre-alpha proof of concept
;;Copyright 2006, Bruce Ingalls. See http://www.gnu.org/ for GPL3 license

;;Bugs: w32 assumes that Recycler dir was created by virtue of having been used
;;Cygnome or kde-cygwin will use the w32 Recycler. Likewise for Mac/Fink
;;Limited support for remote systems (Tramp,Ange-ftp,Efs)

;;Docs: http://www.emacswiki.org/cgi-bin/wiki/BackupDirectory
;;This is not part of Emacs, but will be part of http://emacro.sf.net/

(cond
 ((string-match "windows" (symbol-name system-type))
  (progn
    ;;Filter . & .. from w32 recycler directory
    (setq e-trashback
	  (directory-files
	   (concat (getenv "SystemDrive") "/Recycler/") 't "[^.].+$" 'nil))
    ;;Trim, until the first directory is our writable directory
    (while (not (file-accessible-directory-p (car e-trashback)))
      (setq e-trashback (delq (car e-trashback) e-trashback)))
   (setq e-trashback (car e-trashback))))

 ((or (string-match "Macintosh" (emacs-version))
      (string-match "macos" (emacs-version)))
  (progn
    (setq e-trashback (expand-file-name "~/.trash-wildguess/"))
    (message "Where is Mac's trash directory?")))

  ((file-exists-p (expand-file-name "~/.gnome/Desktop/Trash/"))
    (setq e-trashback (expand-file-name "~/.gnome/Desktop/Trash/")))

  ((file-exists-p (expand-file-name "~/.kde/Desktop/Trash"))
    (setq e-trashback (expand-file-name "~/.kde/Desktop/Trash/")))

;;Others? ~/WASTEBASKET perhaps?
;;Default to ~/.emacs-backup on unsupported systems
  (t (setq e-trashback (expand-file-name "~/.emacs-backup/")))
)


;;Set the results for backup-dir.el.
;;Set '.' current path for /ssh:... style tramp patterns
;;(require 'backup-dir)
(setq backup-directory-alist
      '(("^/[a-z]+:.+$" . ".")
	("." . e-trashback)))

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: trashback
  2006-02-06  0:03 trashback BRUCE INGALLS
@ 2006-02-06 12:10 ` Xavier Maillard
  2006-02-06 16:20 ` trashback Xavier Maillard
  1 sibling, 0 replies; 3+ messages in thread
From: Xavier Maillard @ 2006-02-06 12:10 UTC (permalink / raw)
  Cc: help-gnu-emacs

   From: BRUCE INGALLS <bruce.ingalls@gmail.com>

   It seems to me, that a good place to put emacs backups, is in your
   Wastebasket directory, and let your Operating or Desktop System deal
   with cleanup.
   Frankly, if I need a backup for more than an hour, I'd turn to an
   industrial strength system, such as Arch, Subversion, CVS or RCS.

I just love the idea and more, this is exactly how I managebackup files here
:)

Thank you for your package.

Xavier

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: trashback
  2006-02-06  0:03 trashback BRUCE INGALLS
  2006-02-06 12:10 ` trashback Xavier Maillard
@ 2006-02-06 16:20 ` Xavier Maillard
  1 sibling, 0 replies; 3+ messages in thread
From: Xavier Maillard @ 2006-02-06 16:20 UTC (permalink / raw)
  Cc: help-gnu-emacs

   From: BRUCE INGALLS <bruce.ingalls@gmail.com>

   ;;Version 2006-2-5 is a poorly tested pre-alpha proof of concept
   ;;Copyright 2006, Bruce Ingalls. See http://www.gnu.org/ for GPL3 license

What does this mean ?? Do you release this file under the (non-existent) GPLv3
license or what ?

Xavier

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-02-06 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-06  0:03 trashback BRUCE INGALLS
2006-02-06 12:10 ` trashback Xavier Maillard
2006-02-06 16:20 ` trashback Xavier Maillard

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.