diff options
author | Yoni Rabkin <yoni@rabkins.net> | 2019-05-29 13:11:46 -0400 |
---|---|---|
committer | Yoni Rabkin <yoni@rabkins.net> | 2019-05-29 13:11:46 -0400 |
commit | f7e27094f09432b40ced77c7163cd29f338b7db6 (patch) | |
tree | 20b7f60b423080760f6fbb5d2915e904c3820de3 /lisp | |
parent | 2253146e5607e12f62b0c1c474fded1219da2d5d (diff) |
* lisp/emms-source-playlist.el: make less surprising
Will now warn if the current playlist buffer isn't the one being
visited, instead of silently saving the current playlist buffer.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/emms-source-playlist.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/emms-source-playlist.el b/lisp/emms-source-playlist.el index 9536937..5f88a7b 100644 --- a/lisp/emms-source-playlist.el +++ b/lisp/emms-source-playlist.el @@ -147,13 +147,19 @@ The default format is specified by `emms-source-playlist-default-format'." emms-source-file-default-directory emms-source-file-default-directory nil))) - (with-temp-buffer - (emms-source-playlist-unparse format - (with-current-emms-playlist - (current-buffer)) - (current-buffer)) - (let ((backup-inhibited t)) - (write-file file emms-source-playlist-ask-before-overwrite)))) + (if (or (eq emms-playlist-buffer (current-buffer)) + (and (not (eq emms-playlist-buffer (current-buffer))) + (y-or-n-p + (format "Current playlist buffer (%s) is not the one you are visiting (%s). Save anyway?" + emms-playlist-buffer (current-buffer))))) + (with-temp-buffer + (emms-source-playlist-unparse format + (with-current-emms-playlist + (current-buffer)) + (current-buffer)) + (let ((backup-inhibited t)) + (write-file file emms-source-playlist-ask-before-overwrite))) + (message "aborting save"))) (defun emms-source-playlist-determine-format (&optional parse-files) "Determine the playlist format of the current buffer. |