Add functions for working with fdupes output
This commit is contained in:
parent
7f55fd2017
commit
de362feaed
|
@ -391,3 +391,29 @@ ffmpeg must be installed on your system, of course."
|
|||
(if (directory-name-p (dired-file-name-at-point))
|
||||
(dired-find-file)
|
||||
(launch-files-dired nil (dired-get-marked-files))))
|
||||
|
||||
(defun contrapunctus-delete-file-at-point (&optional prefix)
|
||||
(interactive "P")
|
||||
(let ((file (buffer-substring (point-at-bol)
|
||||
(point-at-eol))))
|
||||
(if (file-exists-p file)
|
||||
(progn
|
||||
(delete-file file)
|
||||
(if prefix
|
||||
;; delete current line
|
||||
(delete-region (point-at-bol)
|
||||
(1+ (point-at-eol)))
|
||||
;; delete current paragraph
|
||||
(mark-paragraph)
|
||||
(delete-active-region)
|
||||
(forward-line 2))
|
||||
(message "Deleted %s" file))
|
||||
(error "File %s does not exist!" file))))
|
||||
|
||||
(defun contrapunctus-file-at-point-exists-p ()
|
||||
(interactive)
|
||||
(let ((file (buffer-substring (point-at-bol)
|
||||
(point-at-eol))))
|
||||
(if (file-exists-p file)
|
||||
(message "%s" t)
|
||||
(error "File %s does not exist!" file))))
|
||||
|
|
Loading…
Reference in New Issue