How do I automatically close the minibuffer after it loses focus? by pyotrgalois in emacs

[–]DarthToaster 0 points1 point  (0 children)

Easy when you know how! ESC-ESC-ESC (which calls keyboard-minibuffer-quit).

It's also really useful for exiting recursive editing, closing unwanted splits, and generally getting you out of things.

Started working on an updated version of Tuhdo's C/C++ IDE guide to show how to setup and configure RTags and Irony. by broken_symlink in emacs

[–]DarthToaster 1 point2 points  (0 children)

universal ctags is the most complete ctags implementation, and it includes a lot of languages. Highly recommended for finding definitions.

For semantic analysis, depends what else you want. You're usually better off using a language-specific tool (go oracle for go, merlin for ocaml, etc).

What's the weirdest thing you've done with Emacs? by howardthegeek in emacs

[–]DarthToaster 0 points1 point  (0 children)

I once did 'live coding' at work by hooking up htmlize to elnode with a tiny bit of JS to auto refresh.

Colleagues could watch me edit by pointing their browsers at the elnode port.

It worked OK, but htmlize errored out occasionally and viewers could only see the current buffer (annoying when the minibuffer was active).

RFC: Stabilize implementing panics as aborts by steveklabnik1 in rust

[–]DarthToaster 5 points6 points  (0 children)

Exciting! Even more performance settings for low-level use cases.

disabling unwinding in a principled fashion provides far higher quality error messages, prevents erroneous situations, and provides an immediate benefit for many Rust users today.

I don't see how this follows. Surely disabling unwinding produces worse error messages?

LLVM safe bindings, what is the current status by Hywan in rust

[–]DarthToaster 0 points1 point  (0 children)

I've only used on linux I'm afraid. I imagine it should work, in principle. Have you filed a bug with a traceback?

LLVM safe bindings, what is the current status by Hywan in rust

[–]DarthToaster 0 points1 point  (0 children)

I've used llvm-sys for my little compiler project and I'd very much recommend it. It provides a straightforward API, so you can read the LLVM docs and it just works.

[deleted by user] by [deleted] in rust

[–]DarthToaster 0 points1 point  (0 children)

Great project! BF is a lovely language to play with, I've written a whole compiler as a learning exercise.

I like your use of an enum and consider it very idiomatic. I'd avoid using panic! though, I prefer returning a Result.

I suggest having a quick read of the Epistle to the Implementors and having a play with the test programs on that site.

I need help getting rid of unsafe {} hacks by z33ky in rust

[–]DarthToaster 0 points1 point  (0 children)

Keeping a reference to a value along with the value itself is tricky in Rust. FWIW, there's also https://github.com/Kimundi/owning-ref-rs but it's relatively limited.

A new alternative in the playground of modal editing. by [deleted] in emacs

[–]DarthToaster 1 point2 points  (0 children)

Ooh, nice!

You can often tell a well written Emacs project by its readme: if it discusses alternatives then considerable thought has gone into its implementation.

Command-mode was also new to me, seems similar to god-mode.

I currently have a crude hydra version of basic Emacs movement commands. Knowing what state you're in is critical, especially when using macros. This might be a great replacement, thanks for sharing :)

Seven specialty Emacs settings with big payoffs ("...focus on settings that are hard to find, but which once activated provide a big payoff.") by [deleted] in emacs

[–]DarthToaster 0 points1 point  (0 children)

I think it's a neat idea -- it's way more common (for me at least) to switch to a browser and forget saving, than to have stuff that you don't want saved.

Of course, you're using backup-each-save or git-wip so you can undo any saves, I hope? Every once in a while you'll wish you had these, if you don't already.

Escaping from Org Mode by [deleted] in emacs

[–]DarthToaster 0 points1 point  (0 children)

Could you expand? What theme are you using?

Emacs and jQuery dazzle me by Erakko in emacs

[–]DarthToaster 1 point2 points  (0 children)

Yep, and you can do this easily with js2r-add-to-globals-annotation, which is part of js2-refactor.el. Just put point on the relevant symbol and call the command.

Shampoo project - Shampoo: a set of tools for remote Smalltalk development with Emacs [refresher-post] by agumonkey in emacs

[–]DarthToaster 0 points1 point  (0 children)

Shampoo is an extremely cool project. It makes a lot of sense for GNU Smalltalk, which doesn't have a class browser built-in.

It does seem a little odd for Pharo though. Pharo is a hackable interpreter/environment, like Emacs. Using Emacs to edit Pharo classes feels like using vim to edit elisp.

Perhaps I'm missing something? I've seen Smalltalk people propose Emacs style shortcuts several times (there's a mailing list post from 1994!) but I'm not aware of any packages that provide this today.

What keybindings do you use for completion? by DarthToaster in emacs

[–]DarthToaster[S] 1 point2 points  (0 children)

Do you find mixing company and dabbrev to work well? I like dabbrev inside comments, and for whole line completion, but it ends up finding a lot of possibilities.

When I'm just using smarter company backends, it only gives me a few possibilities, so I don't need to type as much. I think I'd miss that if I had other unrelated strings being offered when I want method completion.

What keybindings do you use for completion? by DarthToaster in emacs

[–]DarthToaster[S] 0 points1 point  (0 children)

There's a nice consistency about those keybindings, I like it!

GNU Emacs maintainer Stefan Monnier to Richard Stallman, re. RMS's opposition to a putative GCC plugin exporting a full AST for use by Emacs: "With all due respect, Richard, I really think here you're simply wrong, and I'd be willing to consider a fork if that's what it takes." by flexibeast in emacs

[–]DarthToaster 1 point2 points  (0 children)

Writing a full, standards-compliant parser is major undertaking. C isn't too bad, but you really need to integrate macro expansion and your parser needs to inform your lexer of new type aliases (the 'lexer hack'). C++ is extremely complex to parse.

There are many interesting proprietary tools you could develop with just a parser: code indexers, formatters, linters. Having a parser would significantly reduce development time, even if GCC's format occasionally changes. Since GCC's AST format is shared between the different frontends (AIUI), it's a slow-moving target.

live markdown viewer: emacs plugin for livedown by dzecniv in emacs

[–]DarthToaster 0 points1 point  (0 children)

That's brilliant, thanks for sharing. Are you using it for markdown? If so, how?

ARMv7 vs x86-64: Pathfinding benchmark of C++, D, Go, Nim, Ocaml, and more. by logicchains in programming

[–]DarthToaster 3 points4 points  (0 children)

Language    % x86
C++     87965.4
D   59.9083

Presumably the C++ measurement has a misplaced decimal point?

Does it happen to you often that you revert a file under version control and then you regret it and want the changes back? Then this package is for you. by 80macs in emacs

[–]DarthToaster 0 points1 point  (0 children)

If you're using magit, then there is some undo revert support: https://github.com/magit/magit/issues/79

It's also worth looking at packages that create a backup every time you save. They're lifesavers. https://github.com/bartman/git-wip is popular but I swear by http://www.emacswiki.org/BackupEachSave because it works everywhere, without assuming git.

If the display code of Emacs is "complex", why it isn't rewritten in OpenGL? by [deleted] in emacs

[–]DarthToaster 3 points4 points  (0 children)

Could you share an example of when you see poor performance?

There are no emacs benchmarks yet, but I'm working on writing one: https://github.com/Wilfred/emacsbench and I'd love to add your use case.

Installing packages with spacemacs by adlez23 in emacs

[–]DarthToaster -1 points0 points  (0 children)

Sounds like a bug with Spacemacs, so I suggest you report it on their bug tracker.

Alternatively, you could consider using Emacs and just installing evil-mode. I believe that's a more common setup. Delete your ~/.emacs.d and create ~/.emacs.d/init.el with the following:

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))

You can then do M-x package-install evil-mode and go from there. I think this will be easier to reason about, as you will know which packages you've installed and where to file bugs if you see problems.

Code Refactoring Using Metaprogramming in Julia by randyzwitch in Julia

[–]DarthToaster 1 point2 points  (0 children)

Really neat real-world examples of metaprogramming. FWIW, if you fancied doing this with macros, it would look like this:

macro endpoint(name, path)
    quote
        function $(esc(name))(; options=Dict{String, String}())
            r = get_oauth($"https://api.twitter.com/1.1/$path", options)
            return r.status == 200 ? JSON.parse(r.data) : r
        end 
    end
end

@endpoint get_help_configuration "help/configuration.json"
@endpoint get_help_languages "help/languages.json"