3 ms·
> The editor should try to find if 'file:5' exist and open it if so, if it doesn't it should try to open 'foo' and then go to line 5. Opening a file is often d
by masklinn 4y ago
> The editor should try to find if 'file:5' exist and open it if so, if it doesn't it should try to open 'foo' and then go to line 5.
Opening a file is often done in creation, and `file:5` is a perfectly valid filename, so it's a bit debatable for a default.
OTOH in Emacs you should be able to define a find-file-not-found-functions hook[0] and implement whatever fallback you want. I assume `emacs <file>` calls `find-file` after it's initialised the editor itself.
[0] https://www.gnu.org/software/emacs/manual/html_node/elisp/Visiting-Functions.html#index-find_002dfile_002dnot_002dfound_002dfunctions https://www.gnu.org/software/emacs/manual/html_node/elisp/Vi...
- Measter 4y ago> Opening a file is often done in creation, and `file:5` is a perfectly valid filename, so it's a bit debatable for a default. It gets even more fun on Windows! Giving a filename of `foo:5` can result in a file called `foo` with an alternate datastream called `5`.
- renox 4y ago> Opening a file is often done in creation, and `file:5` is a perfectly valid filename, so it's a bit debatable for a default You're right, but even as an option I think it'd be nice.