summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-10-14 14:37:53 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2011-10-14 14:37:53 -0400
commitee0b45e4c240590d0a6758731bbfda7a6caad5c2 (patch)
treedf862047c70b8290c767f6373200f4d06cd94406 /lisp
parent984889776cb97e1c80d763767770de4787df6c89 (diff)
downloademacs-ee0b45e4c240590d0a6758731bbfda7a6caad5c2.tar.gz
* lisp/mpc.el (mpc-songs-jump-to): Don't burp if the user clicks in an
empty buffer.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/mpc.el6
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 876628940c5..9d9ae37d175 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
+ * mpc.el (mpc-songs-jump-to): Don't burp if the user clicks in an
+ empty buffer.
+
* mouse.el (mouse-drag-mode-line-1): Modify the end-event we pushed on
unread-command-events rather than pushing yet-another event.
diff --git a/lisp/mpc.el b/lisp/mpc.el
index 251e1864927..40ccb456400 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -1996,12 +1996,14 @@ This is used so that they can be compared with `eq', which is needed for
(list (get-text-property (point) 'mpc-file)
posn))))
(let* ((plbuf (mpc-proc-cmd "playlist"))
- (re (concat "^\\([0-9]+\\):" (regexp-quote song-file) "$"))
+ (re (if song-file
+ (concat "^\\([0-9]+\\):" (regexp-quote song-file) "$")))
(sn (with-current-buffer plbuf
(goto-char (point-min))
- (when (re-search-forward re nil t)
+ (when (and re (re-search-forward re nil t))
(match-string 1)))))
(cond
+ ((null re) (posn-set-point posn))
((null sn) (error "This song is not in the playlist"))
((null (with-current-buffer plbuf (re-search-forward re nil t)))
;; song-file only appears once in the playlist: no ambiguity,