In Emacs, on Termux, I’ve got a storage directory. That has my sync folder which backs up lots of stuff with SyncThing. So I wanted a way to have a link to /storage/shared/sync in ~/.
Symlinks
So I remembered symlinks (symbolic links). They make a link from one folder to another, or put a link to a file in one folder, into another folder. Pretty cool!
So, how do I get that done in Emacs? Dired! Dired is the file manager inside Emacs. So, it has a key, capital S, for making a symlink. But does it do what I want? I ran describe key (C-h k) and press S. Well, it does more of a hard, rigid, link. I like things soft. If I move the link, or the directory it points to, I don’t want it to break that easily.
So, in the help for S, there was Y, which does the softer link I wanted. Technically, it creates a relative symlink. But then how do I set the link file location? Using .., two periods. That moves up one folder. You can combine ../ to make it go back multiple folders. So, with point on my sync folder in ~/storage/shared/, I pressed Y, then ../../, then RET (return/enter). And it worked! Now all I have to do is go to ~/sync, and I’m there!