I have a copy of emacs that I use on a couple of different (windows) computers from a thumb drive, and I am wondering if it is possible to create something that is sort of the equivalent of a bash alias or symlink within emacs? Something that I could use within find-file is the main thing that i'm looking for, so for example: C-f <some link>
would take me somewhere. Currently I have to add a new defun every time i get to a new computer, which is just kind of a pain and I would swear i've seen this somewhere, but months of googling have turned up nothing.
What i've got right now is something like:
(defun go-awesome ()
"Find my way to my work home"
(interactive)
(find-file "c:/cygwin/home/awesome"))
But that feels increadibly overdone and hacky for just visiting a fairly hacky for just visiting a file that i visit semi-regularly. And it requires a lot of effort to set up a new file.
The biggest problem with it though, in my opinion is that it doesn't fit in my workflow. When i want to visit a file i always do C-x C-f
, and if i realize that "hey i'm at work" i then have to C-g M-x go-awesome
. Perhaps it would be more clear if i said that i wanted to be able to do something that is the equivalent of an ln -s /some/awesome/dir
but internal to emacs, instead of built into the OS, so that C-x C-f ~/awesome/some/sub/dir
would work on windows or anywhere else.
I'm not really clear on what you're asking for. I store my commonly-used files in registers in my .emacs:
(set-register ?c '(file . "c:/data/common.txt"))
(set-register ?f '(file . "c:/data/frequent.txt"))
Then I can jump to a file with jump-to-register
(C-x r j
):
For example, "C-x r j c
" takes me to c:/data/common.txt
(loading it if necessary).
Is that what you're looking for?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With