aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Wenbin <wenbinye@gmail.com>2007-06-14 15:58:00 +0000
committerYe Wenbin <wenbinye@gmail.com>2007-06-14 15:58:00 +0000
commit0f92c8f2851542b482047bf138ac14fa735fc228 (patch)
treeb8f6ab911e4d87e2b2f4cb4bcaa51433114c6154
parenta01b8a208cf8820d8c777a48c3af08e21688a30e (diff)
Rename track file after confirm by user
darcs-hash:20070614155834-94065-5daec0b01f392ead46ee58d88544703da34e3057.gz
-rw-r--r--emms-tag-editor.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/emms-tag-editor.el b/emms-tag-editor.el
index 441528b..46d75c4 100644
--- a/emms-tag-editor.el
+++ b/emms-tag-editor.el
@@ -536,18 +536,21 @@ With prefix argument, bury the tag edit buffer."
;; rename local file
(when (and (emms-track-get track 'newname)
(eq (emms-track-get track 'type) 'file)
- (file-writable-p (emms-track-name track)))
+ (file-writable-p (emms-track-name track))
+ (y-or-n-p (format "Rename %s to %s"
+ (emms-track-name track)
+ (emms-track-get track 'newname))))
(setq filename (emms-track-get track 'newname))
(rename-file (emms-track-name track) filename)
(emms-track-set old 'name filename)
;; for re-enter this function
- (emms-track-set track 'newname nil)
(emms-track-set track 'name filename)
(setq need-sync t)
;; register to emms-cache-db
(when (boundp 'emms-cache-modified-function)
(funcall emms-cache-modified-function)
(funcall emms-cache-set-function 'file filename old)))
+ (emms-track-set track 'newname nil)
;; set tags to original track
(dolist (tag emms-tag-editor-tags)
(when (setq val (emms-track-get track (car tag)))