I often get confused about the current desktop I'm using. Currently, I have to call (display-variable desktop-dirname) to see in which desktop I'm working.

It would be much nicer, if the current desktop would be displayed somewhere. The modeline seems to be ok for that.

How can I do that?

  • See Mode Line Format for the gory details of modifying the mode line. See Header Lines for an alternate location of where to put bits of information.
    – NickD
    Jun 19 '20 at 13:12
  • Thanks for mentioning header lines! I'll stick with a much easier solution, though. Jun 24 '20 at 7:12

A very simple solution turned out to be:

(defun mg-desktop-message ()
  "Show the current desktop dirname in the minibuffer."
  (message "Current desktop: %s" desktop-dirname)

Bound to a convenient key. I don't need it all the time, but if I do it's very handy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.