3

I have my entire Spacemacs config syncing between a Mac and a Linux machine, which provides a lot of benefits. My packages are always up to date on both systems, a configuration change on one machine updates the other, etc.

However I'm having a problem where my recent buffer list (ivy-switch-buffer) is saving the absolute paths of my recently opened files. This means that if I open a file on Linux ~/notes.org, it stores /home/mwaldrich/notes.org. Then when I try to switch to this buffer on my Mac, it points to the wrong path since macOS uses /Users/mwaldrich/notes.org.

Is there any way to force Emacs to record recent buffers with paths relative to my home directory?

I have already tried to symlink /home/ to /Users/ on macOS, but this is a temporary fix and doesn't fully solve the issue.

1 Answer 1

2

I think this is controlled by the variable recentf-filename-handlers This tells recentf how to handle the files after processing.

I have (setq recentf-filename-handlers '(abbreviate-file-name)) in my init file (it also can be changed by customization) and my recentf-list contains ~ . This is the variable saved and set in the file that persists recentf

2
  • Thanks, this worked perfectly! How did you find out about this? Commented Mar 17, 2022 at 17:29
  • 1
    This did take me time and I can't remeber tyhe exact but it would have included looking at all the possible customizattion variable e.g. M-x customize-group and respond with recentf Commented Mar 17, 2022 at 18:54

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.