I have the following code which doesn't work:
(eval-when-compile (require 'cl))
(setq mymachine (system-name))
(case mymachine
("HP" (setq package-user-dir (concat user-emacs-directory "packages/hp")))
("DELL" (setq package-user-dir (concat user-emacs-directory "packages/dell")))
("MBP.local" (setq package-user-dir (concat user-emacs-directory "packages/mbp")))
)
There's something happening in the key comparison between the variable mymachine
and its three possible values. The following does work, however:
(when (string= system-name "HP")
(setq package-user-dir (concat user-emacs-directory "packages/hp")))
(when (string= system-name "DELL")
(setq package-user-dir (concat user-emacs-directory "packages/dell")))
(when (string= system-name "MBP.local")
(setq package-user-dir (concat user-emacs-directory "packages/mbp")))
But I would prefer, for the sake of legibility, to use the case
key selection.
What's happening here?