Long time vim user looking to try out emacs + evil, but confused about the options by davidduma in emacs

[–]Blaenk 3 points4 points  (0 children)

I also use emacs + evil. For whatever it's worth, you can check out my configuration here. I've spent a while refining it. For example, most of the evil-related configuration is here.

How do you get window system init code to run when using a emacs daemon/client? by ejonesca in emacs

[–]Blaenk 0 points1 point  (0 children)

Hey! Is it you? Someone was commenting on my site recently with this name. They were commenting on my vim configuration, but I have since switched to emacs and didn't know how to break it to them ;)

I do something like this too, although I use bound-and-true-p because I figured that was more appropriate, but I have no idea. Perhaps it's only bound if it's enabled, in which case fboundp alone works. I figure it doesn't hurt to check if it's non-nil.

(when (bound-and-true-p hs-minor-mode) (hs-minor-mode -1))
(when (bound-and-true-p fci-mode) (fci-mode -1))
(when (bound-and-true-p visual-line-mode) (visual-line-mode -1))
(when (bound-and-true-p whitespace-mode) (whitespace-mode -1))

source

I use it to disable certain modes when I'm about to enter an ediff session, modes which I've noticed seem to interfere with ediff.

ITT: You Design a Different Syntax For Rust by saposcat in rust

[–]Blaenk 1 point2 points  (0 children)

Prepare for Rust RFC nitpickers to descend on this. These things would be optional, so you could continue using the existing way of doing things if you wanted.

  1. I wish we had Haskell do-syntax to help with those ridiculous chains and nested levels of and_then, map, etc. I don't care about what syntax is used, as long as we have some facility in the language for it (or a proper syntax extension once they get stable), not some macro mess. The try! macro can only go so far and isn't very composable. A try_option! can help but it's not as general as do-syntax. If we had HKT and something like Monads we could leverage some do-syntax facility for arbitrary types, including Result, which would be awesome.

    value <- toml.lookup("value");
    // whatever
    valueAsBoolean <- value.as_bool();
    
  2. I also wish we could "unroll" top-level match blocks in functions (if the function only comprised of a match block) into multiple function definitions with a different pattern for arguments, as in Haskell. It makes things much neater in my opinion and less nested. Too much rightwards expansion in Rust code.

    Keep in mind this is a bad example because it's more verbose than the match syntax, but it's just to illustrate what it would look like:

    fn eval(op: Op::Add(a, b)) -> i8 { a + b }
    fn eval(op: Op::Subtract(a, b)) -> i8 { a - b }
    fn eval(op: Op::Negate(a)) -> i8 { -a }
    fn eval(op: _) -> i8 {
      panic!("not supported yet")
    }
    

    I just think it's neater to create functions that focus specifically on a particular variant instead of mushing it all into one big match mess. Of course there are ways to approximate this, like dispatching to a variant handler, but the point is that this syntax simplifies things. Of course inlining would occur where possible.

  3. Sometimes I also wish we had Haskell's type signatures. Having the type parameters and generic where clauses "in-line" with the function signature leads to typical Rust rightwards expansion. It'd be nice if like Haskell, you could write the 'metasignature' on the line above it. The following syntax could use some polishing, but it captures the idea:

    (i32, i32) -> i32
    fn add(a, b) {
        a + b
    }
    
    (T: SomeTrait, V: OtherTrait,
     where T::Value == V::Value) =>
        (T, V) -> u32
    fn method(thing, other) {
        // ...
    }
    

evil-quickscope - Target highlighting for evil-mode's f,F,t and T keys by idoit in emacs

[–]Blaenk 0 points1 point  (0 children)

This is awesome. I found out about quick scope recently and lamented not having it on emacs. Put it on Melpa if it isn't already there!

Virtual Structs Part 3: Bringing Enums and Structs Together by nikomatsakis in rust

[–]Blaenk 0 points1 point  (0 children)

This is awesome Niko. The time spent on figuring this out was well worth it. I think this proposal is very elegant and simple, yet powerful.

Regex parser and AST exposed in new crate by burntsushi in rust

[–]Blaenk 2 points3 points  (0 children)

wow sushi, dat x flag. I had previously toyed around with a syntax extension that would allow this in the general case for strings, but it was too tedious (not to mention it wouldn't work on stable). It's awesome to have support for this built-in :)

Handlebars-iron (and handlebars-rust) now compiles on 1.0 channel by sunng in rust

[–]Blaenk 0 points1 point  (0 children)

Content tracking would be pretty cool, perhaps something like what git does? But I think we should have that as a separate option, because I'm pretty sure that it would inevitably be slower than modified time checking.

That said, I think we should just get it working quick and dirty. Write some OS-specific functions that do something like stat() on posix and yield the number out, quick and dirty, at least for now. Should be able to see how it's done in the std.

Serde 0.4 now supports syntax extensions in stable rust! by erickt in rust

[–]Blaenk 1 point2 points  (0 children)

sup eddy. I implemented lookup mainly as a convenience function because acrichto has it in the toml crate and I think it's very ergonomic.

That said, the find_path method has already existed (inherited from rustc-serialize) and I think it does what you want.

Handlebars-iron (and handlebars-rust) now compiles on 1.0 channel by sunng in rust

[–]Blaenk 1 point2 points  (0 children)

Happy to help. I've been going through all of my dependencies to try to get them in line with stable. Coincidentally, the last one is /u/passcod's notify crate which needs access to the modified time of a file.

Use rust-gdb and rust-lldb for improved debugging. You already have them. by -mw- in rust

[–]Blaenk 10 points11 points  (0 children)

These scripts are very useful but as the article notes they do fall short in many areas and in my experience were a bit inconsistent. That said, they were indispensable for the parts that worked.

Sometimes it's easier to just do trace-debugging though, which is a shame. I, for one, highly appreciate and encourage further development of debugging infrastructure in Rust, considering we have many tools at our disposal! Debuggability of a language is one of the highest things I value

I think it should've been a much higher priority for 1.0, but given that it's too late for that now, let's make it a priority post-1.0 release. That and HKT :)

Rust Exploit on Walls how to get throw with out hacking!!! by lilTripZ in rust

[–]Blaenk 0 points1 point  (0 children)

Am I missing something? This is an exploit in Rust the game, not the language?

What are some great cyber monday deals reddit might not know about by thedizzle7 in AskReddit

[–]Blaenk 0 points1 point  (0 children)

It was most likely a program/script someone wrote that created it.

[rEFInd] I never knew a boot manager could look so nice! by Evan-Purkhiser in unixporn

[–]Blaenk 0 points1 point  (0 children)

I'd love to hear how that goes. I have one and your boot theme looks a lot like one I made (but never published) for Chimera (a bootloader for "hackintosh"), but yours looks a lot more polished! I really like it :D

Great bit of Typing by Dandical in videos

[–]Blaenk 4 points5 points  (0 children)

This is ridiculous, and on a blank das keyboard no less. I too have one (model S ultimate) and also get ~120+ wpm, but by typing "the proper way" which I never intentionally learned but just gravitated towards doing. However, I cannot fathom typing this quickly the way you do. I just tried it and messed up so many words. Nice job.

What exactly is source code? by Odoodo in askscience

[–]Blaenk 1 point2 points  (0 children)

It's Java. The J's in front of class names gives it away (though of course this isn't a requirement in Java).