mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
* lisp/mpc.el (mpc-volume-mouse-set): Don't burp at the boundaries.
This commit is contained in:
parent
426b5dafdd
commit
4ec0cf9c4c
2 changed files with 12 additions and 3 deletions
11
lisp/mpc.el
11
lisp/mpc.el
|
|
@ -1811,9 +1811,14 @@ A value of t means the main playlist.")
|
|||
(char-after (posn-point posn))))
|
||||
'(?◁ ?<))
|
||||
(- mpc-volume-step) mpc-volume-step))
|
||||
(newvol (+ (string-to-number (cdr (assq 'volume mpc-status))) diff)))
|
||||
(mpc-proc-cmd (list "setvol" newvol) 'mpc-status-refresh)
|
||||
(message "Set MPD volume to %s%%" newvol)))
|
||||
(curvol (string-to-number (cdr (assq 'volume mpc-status))))
|
||||
(newvol (max 0 (min 100 (+ curvol diff)))))
|
||||
(if (= newvol curvol)
|
||||
(progn
|
||||
(message "MPD volume already at %s%%" newvol)
|
||||
(ding))
|
||||
(mpc-proc-cmd (list "setvol" newvol) 'mpc-status-refresh)
|
||||
(message "Set MPD volume to %s%%" newvol))))
|
||||
|
||||
(defun mpc-volume-widget (vol &optional size)
|
||||
(unless size (setq size 12.5))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue