aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-10-14 14:37:53 -0400
committerStefan Monnier2011-10-14 14:37:53 -0400
commitee0b45e4c240590d0a6758731bbfda7a6caad5c2 (patch)
treedf862047c70b8290c767f6373200f4d06cd94406
parent984889776cb97e1c80d763767770de4787df6c89 (diff)
downloademacs-ee0b45e4c240590d0a6758731bbfda7a6caad5c2.tar.gz
emacs-ee0b45e4c240590d0a6758731bbfda7a6caad5c2.zip
* lisp/mpc.el (mpc-songs-jump-to): Don't burp if the user clicks in an
empty buffer.
-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 @@
12011-10-14 Stefan Monnier <monnier@iro.umontreal.ca> 12011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * mpc.el (mpc-songs-jump-to): Don't burp if the user clicks in an
4 empty buffer.
5
3 * mouse.el (mouse-drag-mode-line-1): Modify the end-event we pushed on 6 * mouse.el (mouse-drag-mode-line-1): Modify the end-event we pushed on
4 unread-command-events rather than pushing yet-another event. 7 unread-command-events rather than pushing yet-another event.
5 8
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
1996 (list (get-text-property (point) 'mpc-file) 1996 (list (get-text-property (point) 'mpc-file)
1997 posn)))) 1997 posn))))
1998 (let* ((plbuf (mpc-proc-cmd "playlist")) 1998 (let* ((plbuf (mpc-proc-cmd "playlist"))
1999 (re (concat "^\\([0-9]+\\):" (regexp-quote song-file) "$")) 1999 (re (if song-file
2000 (concat "^\\([0-9]+\\):" (regexp-quote song-file) "$")))
2000 (sn (with-current-buffer plbuf 2001 (sn (with-current-buffer plbuf
2001 (goto-char (point-min)) 2002 (goto-char (point-min))
2002 (when (re-search-forward re nil t) 2003 (when (and re (re-search-forward re nil t))
2003 (match-string 1))))) 2004 (match-string 1)))))
2004 (cond 2005 (cond
2006 ((null re) (posn-set-point posn))
2005 ((null sn) (error "This song is not in the playlist")) 2007 ((null sn) (error "This song is not in the playlist"))
2006 ((null (with-current-buffer plbuf (re-search-forward re nil t))) 2008 ((null (with-current-buffer plbuf (re-search-forward re nil t)))
2007 ;; song-file only appears once in the playlist: no ambiguity, 2009 ;; song-file only appears once in the playlist: no ambiguity,