You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The path module should have something like a mktemp command #1255
I was looking at my external_edit_command function and noticed I had hardcoded a /tmp/... path to avoid the pain of using the external mktemp command. The pain is due to the SysV, BSD, and Gnu implementations having different behavior. Not to mention creating a temp file on Windows. A path:mktemp command would be very useful. We don't necessarily want, or need, to mimic the existing external command but obviously do want options to create a unique directory versus a regular file and some sort of pattern mechanism to control the naming of the final component of the path.
I sometimes wonder if it’d be useful to provide a way to write Elvish modules in Go (like how Python can load third-party modules implemented in C), so this kind of things can be experiemented on more easily. (Although path:mktemp would be a useful addition regardless of such an extension API.)
@uranusjr, The Go plugin package would allow Elvish to load third-party modules written in Go. But it doesn't support Windows and it wouldn't make experimenting any easier. It's trivial to checkout the current Elvish code, create a new branch, and write code to implement a new feature. Using a plugin mechanism would almost certainly make the process harder, not easier.
Activity
krader1961 commentedon Feb 28, 2021
BTW, My function that I bind to Alt-e (
efor Emacs or edit) and Alt-v (vfor Vim) to make it easy to use my preferred editor to edit a command:uranusjr commentedon Feb 28, 2021
I sometimes wonder if it’d be useful to provide a way to write Elvish modules in Go (like how Python can load third-party modules implemented in C), so this kind of things can be experiemented on more easily. (Although
path:mktempwould be a useful addition regardless of such an extension API.)krader1961 commentedon Feb 28, 2021
@uranusjr, The Go plugin package would allow Elvish to load third-party modules written in Go. But it doesn't support Windows and it wouldn't make experimenting any easier. It's trivial to checkout the current Elvish code, create a new branch, and write code to implement a new feature. Using a plugin mechanism would almost certainly make the process harder, not easier.
Add equivalent of `mktemp` as builtin commands.