diff options
-rw-r--r-- | emms-cache.el | 3 | ||||
-rw-r--r-- | emms-playlist-mode.el | 2 | ||||
-rw-r--r-- | emms.el | 10 |
3 files changed, 13 insertions, 2 deletions
diff --git a/emms-cache.el b/emms-cache.el index 441e70e..958c826 100644 --- a/emms-cache.el +++ b/emms-cache.el @@ -122,7 +122,8 @@ This is used to cache over emacs sessions.") (insert (format "(puthash %S '%S emms-cache-db)\n" k v))) emms-cache-db) - (set-buffer-file-coding-system 'mule-utf-8) + (when (fboundp 'set-buffer-file-coding-system) + (set-buffer-file-coding-system 'utf-8)) (write-region (point-min) (point-max) emms-cache-file) (kill-buffer (current-buffer)) (message "Saving emms track cache...done") diff --git a/emms-playlist-mode.el b/emms-playlist-mode.el index 4ed2d89..21e782e 100644 --- a/emms-playlist-mode.el +++ b/emms-playlist-mode.el @@ -200,7 +200,7 @@ Otherwise play the track immediately." (save-excursion ;; move to the start of the line, in case the point is on the \n, ;; which isn't propertized - (move-beginning-of-line nil) + (emms-move-beginning-of-line nil) (if (not emms-playlist-mode-open-playlists) (emms-playlist-mode-play-current-track) (let* ((track (emms-playlist-track-at)) @@ -472,6 +472,16 @@ whenever possible." (setq next (cdr ptr)))) seq) +(defun emms-move-beginning-of-line (arg) + "Move point to beginning of current line as displayed. +If there's an image in the line, this disregards newlines +which are part of the text that the image rests on." + (if (fboundp 'move-beginning-of-line) + (move-beginning-of-line arg) + (if (numberp arg) + (forward-line (1- arg)) + (forward-line 0)))) + ;;; Convenient macros |