pft / mingus

GNU Emacs control of Music Player Daemon (MPD)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Major modes

seagle0128 opened this issue · comments

Thanks for bringing mingus back to Emacs 28+!

May I know why not using define-derived-mode to define the major modes? It will make the code simple and clean.

mingus/mingus.el

Lines 2080 to 2105 in aca914b

(defun mingus-playlist-mode ()
"Mingus playlist mode;
see function `mingus-help' for instructions.
\\{mingus-playlist-map}"
(use-local-map mingus-playlist-map)
(setq major-mode 'mingus-playlist-mode)
(setq mode-name "Mingus-playlist")
(setq buffer-undo-list t)
(delete-all-overlays)
(font-lock-mode -1)
(setq buffer-read-only t)
(setq left-fringe-width 16)
(run-hooks 'mingus-playlist-hooks))
(defun mingus-browse-mode ()
"Mingus browse mode.
\\{mingus-browse-map}"
(let ((res mingus-last-query-results))
(use-local-map mingus-browse-map)
(setq major-mode 'mingus-browse-mode)
(setq mode-name "Mingus-browse")
(setq buffer-undo-list t)
(delete-all-overlays)
(run-hooks 'mingus-browse-hook)
(set (make-local-variable '*mingus-positions*) nil)
(setq buffer-read-only t)

For one thing, they are major modes. And I don't remember what went on in my head that long ago.

If you can rewrite it cleaner with the same, or better, effect, be my guest.

Sorry, my bad! Should be define-derived-mode to define the major modes. I updated the descriptions.

If you will, I can submit PRs.

Sure, go ahead.