From f57d5122531628ee68ad2a9b8b0c057ebf54ef93 Mon Sep 17 00:00:00 2001 From: William Xu Date: Thu, 26 Apr 2007 07:13:00 +0000 Subject: emms-tag-editor.el: Valid emms-track line should start from beginning of the line, so that we can copy & paste stuffs tainted with 'emms-track property as well. darcs-hash:20070426071317-cfa61-f7ce531e7952eff61318b65df063430c2bd5f174.gz --- emms-tag-editor.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/emms-tag-editor.el b/emms-tag-editor.el index 69f43f6..bdc2196 100644 --- a/emms-tag-editor.el +++ b/emms-tag-editor.el @@ -267,7 +267,7 @@ you can apply the command to a selected region." (insert value))))) (defun emms-tag-editor-replace-in-tag (tag from to) - (interactive + (interactive (cons (completing-read "Replace in tag: " emms-tag-editor-tags nil t) (let ((common (query-replace-read-args @@ -457,11 +457,17 @@ edit buffer." (emms-track-set track 'newname val) (emms-track-set track key val)) (emms-track-set track 'tag-modified t)))) - (split-string (buffer-substring (point) - (or - (setq next (next-single-property-change (point) 'emms-track)) - (point-max))) - "\n")) + (let ((end-point (next-single-property-change + (point) 'emms-track))) + (if (and end-point (save-excursion + (goto-char end-point) + (bolp))) + (setq next end-point) + (progn + (setq next nil + end-point (point-max)))) + (split-string (buffer-substring (point) end-point) + "\n"))) (if (emms-track-get track 'tag-modified) (push track tracks)) next)) -- cgit v1.2.3