aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/emms-metaplaylist-mode.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/emms-metaplaylist-mode.el b/lisp/emms-metaplaylist-mode.el
index 819cffb..f90312b 100644
--- a/lisp/emms-metaplaylist-mode.el
+++ b/lisp/emms-metaplaylist-mode.el
@@ -136,15 +136,16 @@
(defun emms-metaplaylist-mode-center-current ()
"Center on the current playlist buffer"
(interactive)
- (when (not emms-playlist-buffer)
- (error "no current playlist buffer"))
- (goto-char (point-min))
- (when (not
- (search-forward-regexp (regexp-quote
- (buffer-name emms-playlist-buffer))
- (point-max) t))
- (error "cannot not find the current playlist buffer"))
- (goto-char (point-at-bol)))
+ (when (buffer-name emms-playlist-buffer)
+ (let ((p nil))
+ (save-excursion
+ (goto-char (point-min))
+ (setq p (search-forward-regexp (regexp-quote
+ (buffer-name emms-playlist-buffer))
+ (point-max) t)))
+ (when (not p) (error "cannot not find the current playlist buffer"))
+ (goto-char p)
+ (goto-char (point-at-bol)))))
(defun emms-metaplaylist-mode-create ()
"Create the meta-playlist buffer."