diff options
author | Pierre Neidhardt <ambrevar@gmail.com> | 2018-04-09 18:10:52 +0530 |
---|---|---|
committer | Pierre Neidhardt <ambrevar@gmail.com> | 2018-04-09 23:09:34 +0530 |
commit | cbfcaeda1f05292994f1725471cb2799664f078e (patch) | |
tree | 1e0ff3fac43af8ac04a2224675fda90771997f87 /lisp | |
parent | 4b7b660acaae68ea1b2945e7a14971bcb37ed0eb (diff) |
* lisp/emms-browser.el: Make 'emms-browser-move-up-level interactive
This is useful for Org-style browsing.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/emms-browser.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emms-browser.el b/lisp/emms-browser.el index b65caf2..bc61873 100644 --- a/lisp/emms-browser.el +++ b/lisp/emms-browser.el @@ -61,6 +61,7 @@ ;; C-j emms-browser-add-tracks-and-play ;; RET emms-browser-add-tracks ;; SPC emms-browser-toggle-subitems +;; ^ emms-browser-move-up-level ;; / emms-isearch-buffer ;; 1 emms-browser-collapse-all ;; 2 emms-browser-expand-to-level-2 @@ -454,6 +455,7 @@ Called once for each directory." (define-key map (kbd "?") 'describe-mode) (define-key map (kbd "C-/") 'emms-playlist-mode-undo) (define-key map (kbd "SPC") 'emms-browser-toggle-subitems) + (define-key map (kbd "^") 'emms-browser-move-up-level) (define-key map (kbd "RET") 'emms-browser-add-tracks) (define-key map (kbd "<C-return>") 'emms-browser-add-tracks-and-play) (define-key map (kbd "C-j") 'emms-browser-add-tracks-and-play) @@ -1076,14 +1078,15 @@ Returns point if currently on a an entry more than LEVEL." "Move up one level if possible. Return true if we were able to move up. If DIRECTION is 1, move forward, otherwise move backwards." + (interactive "P") (let ((moved nil) (continue t) (current-level (emms-browser-level-at-point))) (while (and continue (zerop (forward-line - (or direction -1)))) - (when (> current-level (emms-browser-level-at-point)) + (or (and (numberp direction) direction) -1)))) + (when (> current-level (or (emms-browser-level-at-point) 0)) (setq moved t) (setq continue nil))) moved)) |