+2011-09-14 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * 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".
+
2011-09-14 Juri Linkov <juri@jurta.org>
* isearch.el (isearch-fail-pos): Add new arg `msg'. Doc fix.
(display-buffer-function, special-display-buffer-names)
(special-display-function): Mention help-setup parameter instead
of display-buffer-window in doc-string.
- * help.el (help-window-setup): New argument help-window. Use
- help-window-setup parameter instead of display-buffer-window.
+ * help.el (help-window-setup): New argument help-window.
+ Use help-window-setup parameter instead of display-buffer-window.
Reword some messages.
(with-help-window): Pass window used for displaying the buffer
to help-window-setup. Don't set display-buffer-window.
(push (cons tag select) constraints)))
constraints))
+(defun mpc-constraints-tag-lookup (buffer-tag constraints)
+ (let (res)
+ (dolist (constraint constraints)
+ (when (or (eq (car constraint) buffer-tag)
+ (and (string-match "|" (symbol-name buffer-tag))
+ (member (symbol-name (car constraint))
+ (split-string (symbol-name buffer-tag) "|"))))
+ (setq res (cdr constraint))))
+ res))
+
(defun mpc-constraints-restore (constraints)
(let ((search (assq 'Search constraints)))
(setq mpc--song-search (cadr search))
(setq buf (cdr buf))
(when (buffer-live-p buf)
(let* ((tag (buffer-local-value 'mpc-tag buf))
- (constraint (assq tag constraints)))
+ (constraint (mpc-constraints-tag-lookup tag constraints)))
(when tag
(with-current-buffer buf
- (mpc-select-restore (cdr constraint)))))))
+ (mpc-select-restore constraint))))))
(mpc-selection-refresh))
;; I don't get the ring.el code. I think it doesn't do what I need, but