aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-09-14 17:20:24 -0400
committerStefan Monnier2011-09-14 17:20:24 -0400
commitd3c309545b668fd69fea7d324ece194018e9d224 (patch)
treefbf4ad3e4123f1c8e18a84dd92ab1777271e30d2
parent727799761264b1fc990ea19b2aed1aab3a14df11 (diff)
downloademacs-d3c309545b668fd69fea7d324ece194018e9d224.tar.gz
emacs-d3c309545b668fd69fea7d324ece194018e9d224.zip
* mpc.el (mpc-constraints-tag-lookup): New function.
(mpc-constraints-restore): Use it to make jumping to "album=Foo" apply also to browser "album|playlist".
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/mpc.el14
2 files changed, 20 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1a70c0c3f07..aa8eddae085 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12011-09-14 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * mpc.el (mpc-constraints-tag-lookup): New function.
4 (mpc-constraints-restore): Use it to make jumping to "album=Foo" apply
5 also to browser "album|playlist".
6
12011-09-14 Juri Linkov <juri@jurta.org> 72011-09-14 Juri Linkov <juri@jurta.org>
2 8
3 * isearch.el (isearch-fail-pos): Add new arg `msg'. Doc fix. 9 * isearch.el (isearch-fail-pos): Add new arg `msg'. Doc fix.
@@ -21,8 +27,8 @@
21 (display-buffer-function, special-display-buffer-names) 27 (display-buffer-function, special-display-buffer-names)
22 (special-display-function): Mention help-setup parameter instead 28 (special-display-function): Mention help-setup parameter instead
23 of display-buffer-window in doc-string. 29 of display-buffer-window in doc-string.
24 * help.el (help-window-setup): New argument help-window. Use 30 * help.el (help-window-setup): New argument help-window.
25 help-window-setup parameter instead of display-buffer-window. 31 Use help-window-setup parameter instead of display-buffer-window.
26 Reword some messages. 32 Reword some messages.
27 (with-help-window): Pass window used for displaying the buffer 33 (with-help-window): Pass window used for displaying the buffer
28 to help-window-setup. Don't set display-buffer-window. 34 to help-window-setup. Don't set display-buffer-window.
diff --git a/lisp/mpc.el b/lisp/mpc.el
index 932fb5926fd..8854d4e908f 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -1349,6 +1349,16 @@ when constructing the set of constraints."
1349 (push (cons tag select) constraints))) 1349 (push (cons tag select) constraints)))
1350 constraints)) 1350 constraints))
1351 1351
1352(defun mpc-constraints-tag-lookup (buffer-tag constraints)
1353 (let (res)
1354 (dolist (constraint constraints)
1355 (when (or (eq (car constraint) buffer-tag)
1356 (and (string-match "|" (symbol-name buffer-tag))
1357 (member (symbol-name (car constraint))
1358 (split-string (symbol-name buffer-tag) "|"))))
1359 (setq res (cdr constraint))))
1360 res))
1361
1352(defun mpc-constraints-restore (constraints) 1362(defun mpc-constraints-restore (constraints)
1353 (let ((search (assq 'Search constraints))) 1363 (let ((search (assq 'Search constraints)))
1354 (setq mpc--song-search (cadr search)) 1364 (setq mpc--song-search (cadr search))
@@ -1357,10 +1367,10 @@ when constructing the set of constraints."
1357 (setq buf (cdr buf)) 1367 (setq buf (cdr buf))
1358 (when (buffer-live-p buf) 1368 (when (buffer-live-p buf)
1359 (let* ((tag (buffer-local-value 'mpc-tag buf)) 1369 (let* ((tag (buffer-local-value 'mpc-tag buf))
1360 (constraint (assq tag constraints))) 1370 (constraint (mpc-constraints-tag-lookup tag constraints)))
1361 (when tag 1371 (when tag
1362 (with-current-buffer buf 1372 (with-current-buffer buf
1363 (mpc-select-restore (cdr constraint))))))) 1373 (mpc-select-restore constraint))))))
1364 (mpc-selection-refresh)) 1374 (mpc-selection-refresh))
1365 1375
1366;; I don't get the ring.el code. I think it doesn't do what I need, but 1376;; I don't get the ring.el code. I think it doesn't do what I need, but