diff options
author | William Xu <william.xwl@gmail.com> | 2007-04-26 07:13:00 +0000 |
---|---|---|
committer | William Xu <william.xwl@gmail.com> | 2007-04-26 07:13:00 +0000 |
commit | f57d5122531628ee68ad2a9b8b0c057ebf54ef93 (patch) | |
tree | 4b625dc311aa546e47c76a5d664102b96d3c8258 | |
parent | 864801b7f281534cd7765c214ac5634f40c42059 (diff) |
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
-rw-r--r-- | emms-tag-editor.el | 18 |
1 files 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)) |