github.com/xiaq/elvish@v0.12.0/website/src/blog/0.10-release-notes.md (about) 1 Version 0.10 has been released two and a half months after 0.9, bringing many new features and enhancements. The [second issue](newsletter-sep-2017.html) of Elvish Newsletter accompanies this release. 2 3 # Breaking changes 4 5 * If you are upgrading from an earlier version, Elvish will complain that 6 your database is not valid. This is because Elvish now uses BoltDB for 7 storage. A [database migration 8 tool](https://github.com/elves/upgrade-db-for-0.10) is available. 9 10 * Breaking changes to the editor API: 11 12 * The `$edit:completer` map is now known as `$edit:arg-completer`. 13 14 * The keybinding API has been changed (again). Keybindings for different now 15 live in their own subnamespaces. For instance, keybindings for insert mode 16 used to be `edit:binding[insert]` but is now `edit:insert:binding`. 17 18 * Module names of some editor modes have also been changed for consistency. 19 The completion mode now uses the `edit:completion` module (used to be 20 `edit:compl`). Location mode: `edit:location`; navigation mode: 21 `edit:navigation`. 22 23 * Byte output from prompts now preserve newlines. For instance, if you 24 have `edit:prompt = { echo haha }`, you will now have a trailing 25 newline in the prompt, making your command appear on the next line. To 26 fix this, simple replace `echo` with `print`, which does not print a 27 trailing newline. ([#354](https://github.com/elves/elvish/issues/354)) 28 29 * Breaking changes to the language core: 30 31 * Due to the switch to persistent data structures, assignments of maps 32 now behave as if they copy the entire container. See the section in 33 [some unique semantics](/learn/unique-semantics.html) for an 34 explanation. 35 36 * The implicit `$args` variable is gone, as well as its friends: 37 positional variables `$0`, `$1`, ..., and the special `$@` shorthand 38 for `$@args`. Lambdas defined without argument list (`{ some code }`) 39 now behave as if they have an empty argument list. 40 ([#397](https://github.com/elves/elvish/issues/397)) 41 42 Old lambdas that rely on `$args` or its friends now must declare their 43 arguments explicitly. For instance, `fn ls { e:ls --color=auto $@ }` 44 needs to be rewritten to `fn ls [@a]{ e:ls --color=auto $@a }`. 45 46 * Support for using backquotes for output capture (e.g. ``echo uname is 47 `uname` ``) has been removed. Use parentheses instead (e.g. `echo uname 48 is (uname)`). 49 50 * Backquotes are repurposed for line continuation. A backquote followed by 51 a newline is equivalent to a space. 52 ([#417](https://github.com/elves/elvish/issues/417)) 53 54 * The signature of the `splits` builtin has been changed. The separator used 55 to be an option `sep` but is now the first argument. For instance, `splits 56 &sep=: a:b:c` should now be written as `splits : a:b:c`. 57 58 59 # Notable fixes and enhancements 60 61 * Thanks to the BoltDB migration, Elvish is now a pure Go project! This 62 allows for fully statically linked executables and easy cross compilation. 63 ([#377](https://github.com/elves/elvish/issues/377)) 64 65 * Enhancements to the language core: 66 67 * It is now possible to define options when declaring functions 68 ([#82](https://github.com/elves/elvish/issues/82)). 69 70 * Interrupting Elvish code with Ctrl-C now works more reliably ([#388](https://github.com/elves/elvish/issues/388)). 71 72 * Piping value outputs into a command that does not read the value input (e.g. `range 1000 | echo haha`) no longer hangs ([#389](https://github.com/elves/elvish/issues/389)). 73 74 * New builtins functions and variables (documented in the [builtin module reference](/ref/builtin.html)): 75 76 * New `assoc` and `dissoc` builtin that outputs modified versions of container types. 77 78 * New `keys`, `has-keys` and `has-values` builtins ([#432](https://github.com/elves/elvish/issues/432), [#398](https://github.com/elves/elvish/issues/398), [#407](https://github.com/elves/elvish/issues/407)). 79 80 * A new blackhole variable `$_` has been added. ([#401](https://github.com/elves/elvish/issues/401)) 81 82 * New `replaces` builtin for replacing strings. ([#463](https://github.com/elves/elvish/issues/463)) 83 84 * New `not-eq` builtin for inequality. 85 86 * New `drop` builtin, mirroring `take`. 87 88 * Enhancements to the editor: 89 90 * Matching algorithm used in completion is now programmable with 91 `$edit:-matcher` ([#430](https://github.com/elves/elvish/issues/430)); 92 see [documentation](/ref/edit.html). 93 94 * Elvish can now able to complete arguments with variables. For instance, 95 if you have a directory with `a.mp4` and `a.txt`, and variable `$foo` 96 containing `a`, `echo $foo.<Tab>` now works 97 ([#446](https://github.com/elves/elvish/issues/446)). However, the 98 completion will expand `$foo` into `a`, which is not intended 99 ([#474](https://github.com/elves/elvish/issues/474)). 100 101 * It is now possible to manipulate the cursor position using the 102 experimental `$edit:-dot` variable 103 ([415](https://github.com/elves/elvish/issues/415)). 104 105 * The default prompt now replaces `>` with a red `#` when uid = 0. 106 107 * An experimental custom listing mode (known as "narrow mode" for now) has 108 been introduced and can be started with `edit:-narrow-read`. This means 109 that it is now to implement listing modes entirely in Elvish script. 110 111 Experimental re-implementations of the several standard listing modes 112 (location mode, history lising mode and lastcmd mode) are provided as the 113 bundled `narrow` module. Read [its source in 114 eval/narrow.elv](https://github.com/elves/elvish/blob/e7a8b96d7d4fccb7bafe01f27db9c0fe06c568b4/eval/narrow.elv) 115 for more details. 116 117 * Improvements to the daemon: 118 119 * The daemon now quits automatically when all Elvish sessions are closed. 120 ([#419](https://github.com/elves/elvish/issues/419)) 121 122 * The daemon can now spawned be correctly when Elvish is not installed in 123 `PATH`. 124 125 * Elvish no longer quits on SIGQUIT (usually triggered by `Ctrl-\`), matching 126 the behavior of other shells. It still prints a stack trace though, which 127 can be useful for debugging. 128 ([#411](https://github.com/elves/elvish/issues/411)) 129 130 * A `-compileonly` flag for the Elvish binary is added. It makes Elvish 131 compiles a script (in memory) but does not execute it. It can be used for 132 checking the well-formedness of programs and is useful in editor plugins. 133 ([#458](https://github.com/elves/elvish/issues/458))