Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 03:05
    krader1961 commented #1400
  • 02:32
    krader1961 commented #1400
  • Sep 27 22:08
    xiaq commented #1401
  • Sep 27 21:56
    xiaq commented #1401
  • Sep 27 20:58
    xiaq commented #974
  • Sep 27 20:43
    xiaq labeled #322
  • Sep 26 19:23
    rdw20170120 commented #1401
  • Sep 26 02:44
    krader1961 commented #974
  • Sep 25 18:24
    rdw20170120 commented #974
  • Sep 25 18:08
    rdw20170120 commented #974
  • Sep 25 18:05
    rdw20170120 commented #974
  • Sep 25 18:05
    rdw20170120 commented #453
  • Sep 25 18:04
    rdw20170120 commented #621
  • Sep 25 18:04
    rdw20170120 commented #582
  • Sep 25 17:59
    rdw20170120 opened #1401
  • Sep 25 04:53
    zzamboni commented #974
  • Sep 25 04:05
    krader1961 opened #1400
  • Sep 25 03:33
    krader1961 commented #974
  • Sep 25 02:35
    krader1961 commented #453
  • Sep 24 20:16
    rdw20170120 commented #453
xiaqqaix (Telegram)
@telegram_84517825:elv.sh
[m]
thegrizzlysmit (Telegram)
@telegram_551636417:elv.sh
[m]
hey @zzamboni I'm getting the following error with your modules against the current HEAD
deprecation: the "pipe" command is deprecated; use "file:pipe" instead
/home/grizzlysmit/.elvish/lib/github.com/zzamboni/elvish-modules/util.elv, line 10: pout = (pipe)
deprecation: the "pipe" command is deprecated; use "file:pipe" instead
/home/grizzlysmit/.elvish/lib/github.com/zzamboni/elvish-modules/util.elv, line 11: perr = (pipe)
deprecation: the "prclose" command is deprecated; use "file:close $p[r]" instead
/home/grizzlysmit/.elvish/lib/github.com/zzamboni/elvish-modules/util.elv, line 18: prclose $pout
deprecation: the "prclose" command is deprecated; use "file:close $p[r]" instead
/home/grizzlysmit/.elvish/lib/github.com/zzamboni/elvish-modules/util.elv, line 21: prclose $perr
deprecation: the "prclose" command is deprecated; use "file:close $p[r]" instead
/home/grizzlysmit/.elvish/lib/github.com/href/elvish-gitstatus/gitstatus.elv, line 118: prclose $state[$k]
deprecation: the "pipe" command is deprecated; use "file:pipe" instead
/home/grizzlysmit/.elvish/lib/github.com/href/elvish-gitstatus/gitstatus.elv, line 165: state[$k] = (pipe)
zzamboni (Telegram)
@telegram_278300093:elv.sh
[m]
Have you run epm:upgrade? This is fixed already since a few days ago.
2 replies
fennewald
@fennewald:matrix.org
[m]
I did plot most recent on the left, and that jump was on commit elves/elvish@70cb56b
when I get a chance I'll try and test if with the commits under that branch, just to see if I can pinpoint the exact moment
Kurtis Rader
@krader1961:matrix.org
[m]
You probably won't be able to meaningfully test each individual commit included in the merge. The bulk of the commit is reorganizing the code to allow building an elvish binary with no support for the interactive daemon. What's interesting is that I would not expect that to affect the performance of a non-interactive session. Someone will probably need to profile the code before and after that commit to identify where the extra time is being spent.
dangeroushobo
@dangeroushobo:matrix.org
[m]
is it possible to combine 2 or more maps into a new one?
xiaqqaix (Telegram)
@telegram_84517825:elv.sh
[m]
I don’t think there’s a builtin for that yet, unfortunately
1 reply
xiaqqaix (Telegram)
@telegram_84517825:elv.sh
[m]
If you haven’t moved your modules they probably still live in ~/.elvish/lib which is no longer managed by epm
1 reply
uver
@uver:matrix.org
[m]

I've run into this issue quite a few times now and I'm getting tired of switching shells just run find with the -exec option 😅. Let's say I have this find command:

find 'Anita Lane/' -name "*.flac" -exec ffmpeg -i {} -ab 320k -map_metadata 0 -id3v2_version 3 -write_id3v1 1 ../../ipod/rerun/{}.mp3 \;

How would I get this to work in elvish? The {}s are a "special feature" of the shell it seems so find complains that there is a "missing argument to `-exec'".

1 reply
xiaqqaix (Telegram)
@telegram_84517825:elv.sh
[m]
You need to quote both the {} and the \;
Kurtis Rader
@krader1961:matrix.org
[m]
To clarify xiaq's answer the braces create a lambda. See the discussion of metacharacters: https://elv.sh/ref/language.html#metacharacters. Also, the description of functions: https://elv.sh/ref/language.html#fn. Too, in Elvish a backslash does not act to escape the special meaning of the next character. Simply quote special chars; so ';' rather than \;.
uver
@uver:matrix.org
[m]
Do you have to quote each individual { and } or can you do both together? I already tried '{}' but it gave the same error. I'll try again and actually quote the ; this time instead of just adding a backslash in front.
Kurtis Rader
@krader1961:matrix.org
[m]
Try it: echo a '{}' b ';
And compare that output to this: echo a {} b ;
Katy_hernandez124 (Telegram)
@telegram_1994020486:elv.sh
[m]
Hello
Kurtis Rader
@krader1961:matrix.org
[m]
Welcome. You're a new Elvish shell user?
xiaqqaix (Telegram)
@telegram_84517825:elv.sh
[m]
The {} doesn’t create a lambda; a lambda requires whitespace after the opening {. It creates a braced list with no elements (https://elv.sh/ref/language.html#braced-list) which is special-cased to evaluate to an empty string
uver
@uver:matrix.org
[m]
Ok thank you both! Got it working. The issue was me not quoting the ending semicolon. I figured I needed to escape the {}s but when that didn't work, I was at a bit of a loss.
Adam
@adamfontenot:matrix.org
[m]
Anyone know what the preferred method for security disclosures is for this project?
Adam
@adamfontenot:matrix.org
[m]
I do have to run but if someone could @ me with an appropriate contact method, that would be great. I don't see a security email specified on the site anywhere, so I'm trying here. I'll check back sometime in the next day.
xiaq
@xiaq:matrix.org
[m]
Adam please send me an email: xiaqqaix@gmail.com
dcuadrado (Telegram)
@telegram_89056592:elv.sh
[m]
@zzamboni in the notifier is there a way to know if the process failed? I'd like it to say something out loud if the command failed
1 reply
Kurtis Rader
@krader1961:matrix.org
[m]
dcuadrado (Telegram): Pretty sure zzamboni (Telegram) would appreciate a pull-request to implement that enhancement, or at least an issue to remind him that it needs to be done.
dcuadrado (Telegram)
@telegram_89056592:elv.sh
[m]
that sounds very interesting
Kurtis Rader
@krader1961:matrix.org
[m]
See elves/elvish#1029 for the impetus to implement the core feature that allows capturing that information.
Kurtis Rader
@krader1961:matrix.org
[m]
dcuadrado (Telegram): I opened zzamboni/elvish-modules#21. Comment there if I did not fully capture your requirements or you intend to make the necessary changes.
dcuadrado (Telegram)
@telegram_89056592:elv.sh
[m]
thanks
Isaac See (Telegram)
@telegram_2016357795:elv.sh
[m]
Hi guys
Hi
Johann Og
@kronolynx
HI, I would like to use vi style bindings, I found this issue elves/elvish#728 and the suggestion is to use
use binding
binding:install
edit:insert:binding["Ctrl-["] = $edit:command:start~
but when I add that to my config I get:
Exception: no such module: binding
/home/krono/.elvish/rc.elv, line 56: use binding
Any suggestions ?
xiaqqaix (Telegram)
@telegram_84517825:elv.sh
[m]
Johann Og
@kronolynx

thanks, if I use

use binding
edit:insert:binding["Ctrl-["] = $edit:command:start~

then I get the error:

Exception: no such module: binding
/home/krono/.elvish/rc.elv, line 56: use binding

if I add only this line

edit:insert:binding["Ctrl-["] = $edit:command:start~
vim keybindings are not enabled
xiaqqaix (Telegram)
@telegram_84517825:elv.sh
[m]
You need to press ESC to enter vi command mode, did you do that?
The vi command mode is very incomplete as I mentioned in the comment so it's probably not worth bothering anyway
Johann Og
@kronolynx
Thanks
Kurtis Rader
@krader1961:matrix.org
[m]
Kronolynx (Telegram): I recommend leaving the default emacs bindings in place. For non-trivial editing of the command line it's easy to drop into a real vi editor. I have this in my rc.elv:
# Arrange for [alt-e] and [alt-v] to edit the current command buffer using my
# prefered external editor.
edit:insert:binding[Alt-e] = $interactive:external_edit_command~
edit:insert:binding[Alt-v] = $interactive:external_edit_command~
Also use interactive which loads my lib/interactive.elv module that contains this:
fn external_edit_command {
  temp-file = (path:temp-file)
  print $edit:current-command > $temp-file
  try {
    $E:EDITOR $temp-file[name] </dev/tty >/dev/tty 2>&1
    edit:current-command = (slurp < $temp-file[name])[..-1]
  } else {
    file:close $temp-file
    rm $temp-file[name]
  }
}
2 replies
hhanche (Telegram)
@telegram_558831502:elv.sh
[m]
Why do you use an else block for cleanup? I'd have thought a finally block would be more appropriate.
xiaqqaix (Telegram)
@telegram_84517825:elv.sh
[m]
Yeah, the use of else seems wrong here - else blocks are run when there are no exceptions
Kurtis Rader
@krader1961:matrix.org
[m]
I did it that way so that if something goes wrong I still had a chance to recover the contents of the temporary file. But in practice the only time that happens is if I deliberately exit Vim with :cq! so, yeah, I should probably change it to a finally block.
xiaqqaix (Telegram)
@telegram_84517825:elv.sh
[m]
Ah, that makes sense
Kurtis Rader
@krader1961:matrix.org
[m]
arekushi (Telegram): I set my env var like this so it is an absolute path: set-env EDITOR (search-external vim).
> put $E:EDITOR
▶ /usr/local/bin/vim
If you want the PATH resolution to be dynamic every time you invoke it then use xiaqqaix (Telegram)'s solution.
arekushi (Telegram)
@telegram_95697363:elv.sh
[m]
That makes sense, thank you!
sjohannes (IRC)
@irc_sjohannes:elv.sh
[m]
1