From 65f6a37a0852d705661dc5b23ebbefdd8a2a8781 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Thu, 20 Jul 2017 01:23:32 +0100 Subject: [PATCH] el/dot-emacs.el: Redefine the playlist header line to preserve mark. The definition of the header line has some Lisp code which inserts stuff into a temporary buffer, and that sets `deactivate-mark'. Preserve this variable so the mark remains active after cursor movement. --- el/dot-emacs.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/el/dot-emacs.el b/el/dot-emacs.el index 3ea5cd5..7f6f3fb 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -3899,6 +3899,23 @@ there is sadness." mode-line-buffer-identification))) (add-hook 'mpc-tagbrowser-mode-hook 'mdw-mpc-hack-tagbrowsers) +(defun mdw-mpc-hack-songs () + (setq-local header-line-format + ;; '("MPC " mpc-volume " " mpc-current-song) + (list (propertize " " 'display '(space :align-to 0)) + ;; 'mpc-songs-format-description + '(:eval + (let ((deactivate-mark) (hscroll (window-hscroll))) + (with-temp-buffer + (mpc-format mpc-songs-format 'self hscroll) + ;; That would be simpler than the hscroll handling in + ;; mpc-format, but currently move-to-column does not + ;; recognize :space display properties. + ;; (move-to-column hscroll) + ;; (delete-region (point-min) (point)) + (buffer-string))))))) +(add-hook 'mpc-songs-mode-hook 'mdw-mpc-hack-songs) + (eval-after-load "mpc" '(progn (define-key mpc-mode-map "m" 'mdw-mpc-select) -- 2.11.0