diff options
| author | Stefan Monnier | 2014-04-30 21:08:08 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-04-30 21:08:08 -0400 |
| commit | 4ec0cf9c4c29758bd46eec39313984434d455656 (patch) | |
| tree | a8ca5935f4b20e87080d09dba079d49ce5a7a0cd | |
| parent | 426b5dafdd837328d624a8ec5bfd567f2865c9f5 (diff) | |
| download | emacs-4ec0cf9c4c29758bd46eec39313984434d455656.tar.gz emacs-4ec0cf9c4c29758bd46eec39313984434d455656.zip | |
* lisp/mpc.el (mpc-volume-mouse-set): Don't burp at the boundaries.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/mpc.el | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 769d06028b4..669467687d2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2014-05-01 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * mpc.el (mpc-volume-mouse-set): Don't burp at the boundaries. | ||
| 4 | |||
| 1 | 2014-04-30 Eli Zaretskii <eliz@gnu.org> | 5 | 2014-04-30 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * dired.el (dired-initial-position-hook, dired-initial-position): | 7 | * dired.el (dired-initial-position-hook, dired-initial-position): |
diff --git a/lisp/mpc.el b/lisp/mpc.el index d89231e81b9..d569610a615 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el | |||
| @@ -1811,9 +1811,14 @@ A value of t means the main playlist.") | |||
| 1811 | (char-after (posn-point posn)))) | 1811 | (char-after (posn-point posn)))) |
| 1812 | '(?◁ ?<)) | 1812 | '(?◁ ?<)) |
| 1813 | (- mpc-volume-step) mpc-volume-step)) | 1813 | (- mpc-volume-step) mpc-volume-step)) |
| 1814 | (newvol (+ (string-to-number (cdr (assq 'volume mpc-status))) diff))) | 1814 | (curvol (string-to-number (cdr (assq 'volume mpc-status)))) |
| 1815 | (mpc-proc-cmd (list "setvol" newvol) 'mpc-status-refresh) | 1815 | (newvol (max 0 (min 100 (+ curvol diff))))) |
| 1816 | (message "Set MPD volume to %s%%" newvol))) | 1816 | (if (= newvol curvol) |
| 1817 | (progn | ||
| 1818 | (message "MPD volume already at %s%%" newvol) | ||
| 1819 | (ding)) | ||
| 1820 | (mpc-proc-cmd (list "setvol" newvol) 'mpc-status-refresh) | ||
| 1821 | (message "Set MPD volume to %s%%" newvol)))) | ||
| 1817 | 1822 | ||
| 1818 | (defun mpc-volume-widget (vol &optional size) | 1823 | (defun mpc-volume-widget (vol &optional size) |
| 1819 | (unless size (setq size 12.5)) | 1824 | (unless size (setq size 12.5)) |