aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorforcer <forcer>2006-06-07 20:23:00 +0000
committerforcer <mwolson@gnu.org>2006-06-07 20:23:00 +0000
commitf9212a8941c84f9b1fe0056f0901b7e847367564 (patch)
treeabf583dcedb50674fa0ef4fe044fa4fa895c4f17
parent96a3ac588fbbd593558a305d95039abe8474a63c (diff)
emms.el, simplified emms-property-region considerably.
darcs-hash:20060607202310-2189f-16435d8796c61ef090f2215117e8042a482fde2b.gz
-rw-r--r--emms.el23
1 files changed, 4 insertions, 19 deletions
diff --git a/emms.el b/emms.el
index 1459b2b..d9269bb 100644
--- a/emms.el
+++ b/emms.el
@@ -1026,25 +1026,10 @@ ignore this."
;;; Helper functions
(defun emms-property-region (pos prop)
"Return a pair of the beginning and end of the property PROP at POS."
- (let ((beg nil)
- (end nil))
- (save-excursion
- (goto-char pos)
- (while (and (not (bobp))
- (get-text-property (point)
- prop))
- (backward-char))
- (when (not (get-text-property (point)
- prop))
- (forward-char))
- (setq beg (point))
- (goto-char pos)
- (while (and (not (eobp))
- (get-text-property (point)
- prop))
- (forward-char))
- (setq end (point)))
- (cons beg end)))
+ (let ((begin (next-single-property-change pos prop))
+ (end (previous-single-property-change pos prop)))
+ (cons (or begin (point-min))
+ (or end (point-max)))))
(defun emms-shuffle-vector (vector)
"Shuffle VECTOR."