Commit Graph

24 Commits

Author SHA1 Message Date
Qi Xiao
a3f4384495 Move all elvdocs into .d.elv files.
The elvdocs still use the old format (#elvdoc:fn or #elvdoc:var) for now, but
will be changed to "fn" and "var" forms soon.

Also remove the accidentally committed cmd/mvelvdoc. It has been used to perform
the conversion automatically but is not supposed to be committed.
2022-11-20 21:59:45 +00:00
Qi Xiao
6c6797b4c1 Remove use of "e.g.," and "i.e.,".
Some of the uses are replaced by plain English phrases like "such as", and the
remaining have the trailing commas removed.
2022-11-20 15:44:29 +00:00
Qi Xiao
94e43cd2fd pkg/eval: Add tests for errors in tilde expansion. 2022-06-19 23:34:36 +01:00
Qi Xiao
51e4d97568 interface{} -> any now that Elvish requires Go 1.18. 2022-03-20 16:17:19 +00:00
Qi Xiao
653c9f9d0f Remove dir-history, deprecated since 0.17.0. 2022-01-03 00:47:41 +00:00
Qi Xiao
e299010be8 pkg/eval: Export the config fields and remove access methods. 2021-10-05 00:53:38 +01:00
Qi Xiao
56038311da pkg/eval: Remove elvdoc for the removed path-* commands. 2021-10-03 23:03:52 +01:00
Qi Xiao
70cb56b568 Merge branch 'master' into reader-gone 2021-06-20 22:22:37 +01:00
Qi Xiao
6e75f3468c Move API of pkg/store into pkg/storedefs.
This makes the nodaemon entrypoint not depend on boltdb at all, reducing its
size by 100KB (on darwin-arm64).
2021-06-19 01:54:00 +01:00
Qi Xiao
657b73122f Change all builtin commands writing value output to surface ReaderGone.
Also replace (*Frame).OutputChan with (*Frame).ValueOutput, which returns a
small interface for writing to the value output that is also aware when the
reader is gone.
2021-06-18 00:14:59 +01:00
Kurtis Rader
9a576529a3 Replace ErrArgs with more specific errors
This also replaces the slightly awkward "arguments here" reason with
"argument count" as the "what" for a typical errs.ArityMismatch
exception. It also reformats most of the constructors so that the "what"
is on the same line. This makes `grep errs.ArityMismatch **.go` more
useful as a result.
2021-06-13 22:42:04 +01:00
Kurtis Rader
20decc5976 Implement edit:command-history &dedup
This implements `&dedup` and `&newest-first` options for
`edit:command-history`. This makes it noticably cheaper to feed unique
command history into external commands like `fzf`.

Related #1053
Fixes #568
2021-05-30 23:49:46 +01:00
Qi Xiao
b53a92b964 Remove all builtin commands deprecated since 0.15.0. 2021-04-08 23:07:50 +01:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Kurtis Rader
be712d5405
Introduce the path: module (#1203)
* Introduce the `path:` module

This is based on https://github.com/elves/elvish/pull/1084 by @kolbycrouch
submitted five months ago. It addresses all of the feedback on that
change and includes other documentation and unit test improvements. It
also includes a couple of extensions to the original P.R., such as a
`path:is-abs` command.

I decided to resurrect that change because I want better support for
filesystem path manipulation so that users can replace non-portable
external commands such as `realpath` and `find` with Elvish builtins. This
is a baby step towards that goal.

Related #849

* Add a `path:is-regular` command

This adds a `path:is-regular` command.  This is for symmetry with the
`path:is-dir` command and the glob `[type:regular]` modifier.

It also adds support for symlinks in the `testutil.Applydir` function
and change the path unit test to use it.

* Rename path:real to path:eval-symlinks
2021-01-16 23:21:33 +00:00
Qi Xiao
a2790af67a pkg/eval: Clean up the structure and methods of Evaler and Frame.
- Make Evaler mostly thread-safe. The only remaining thread-unsafe part is the
  modules field, which is more tricky than other fields.

- Remove the state and evalerScopes type, and move their fields into Evaler.

- Expose valuePrefix via a get method, and change PortsFromFiles to take the
  prefix instead of a *Evaler. Also expose a PortsFromStdFiles.

- Make Evaler a normal field of Frame, instead of an embedded field. This makes
  access to global states more explicit.
2021-01-05 00:22:09 +00:00
Qi Xiao
734eb955e2 pkg/eval: Use exported methods to access ports from builtin functions. 2020-10-10 22:28:13 +01:00
Qi Xiao
11898f763a pkg/util: Break into fsutil/ and logutil/. 2020-09-03 05:27:18 +01:00
Kurtis Rader
0f6b4bb737 Test $pwd behavior
Related #1062
Resolves #1120
2020-09-03 04:25:38 +01:00
Qi Xiao
9b2b33b429 pkg/eval: Move elvdoc comments before the implementations. 2020-08-16 18:46:29 +01:00
Qi Xiao
bd1a6e98dc pkg/eval/vals: Rework the structmap mechanism.
* Fields may now be exposed via getter methods.

* Field names are automatically converted to dashed-case.

* Assoc behavior is no longer implemented for structmaps.

* The IsStructMap marker method no longer takes a special marker argument. There
  is a little danger of a value accidentally implementing this method.
2020-06-28 01:26:58 +01:00
Qi Xiao
41985123d3 Move all docs for builtins to the Go code. 2020-01-18 08:12:50 -05:00
Qi Xiao
cbe0e3e7e7 Merge pkg/store/storedefs into pkg/store. 2019-12-26 18:05:13 +00:00
Qi Xiao
e45fdf7228 Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00