HN user

cksk

49 karma
Posts1
Comments14
View on HN

The array at the end of the struct is not a VLA on the stack. When you allocate the struct, you add enough extra to hold the contents of the array. VLAs on the stack are pretty much universally considered a bad idea, as far as I can tell.

This is not me; this is Protesilaos Stavrou, a well-known and cherished member of the Emacs community. I just watched this video and, since I'm in no position of helping directly, decided to share it here.

What you’re not getting is the conscious part of “conscious decision”. The brain makes the decision BEFORE the consciousness is aware of it. But that’s not how we think we decide stuff; the experience we have is that we consciously choose to do something. The experiment shows that decision is actually made by the unconscious part of the mind, and the consciousness is only made aware of it later, while still believing it was in control the entire time.

Same here, but, if you use it with Gmail, let me recommend Abdó Roig-Maranges' fork of offlineimap, which implements labels[1][2]! That way you can sync only [Gmail].All Mail and all the other info (such as /Inbox, /Sent and any other custom labels) come as X-Keywords in the header (no duplicates, and no lost metadata)[3]. And mu4e supports all this[4]!

[1] https://github.com/aroig/offlineimap

[2] The homebrew tap, if that's your thing: https://github.com/jeastman/homebrew-offlineimapwithlabels

[3] [Gmail].Trash and [Gmail].Drafts are also real folders, not just labels. You should sync them too. [Gmail].Sent Mail is just a saved search for /Sent labels. mu4e asks for a "sent" folder but, since you should (setq mu4e-sent-messages-behavior 'delete) anyway with Gmail, it becomes a dummy folder locally, and all is well.

[4] A good config example: https://github.com/pygatea/dotfiles/blob/master/emacs.d/conf...

I really think Emacs is much easier to figure out than it looks. Meaning: you probably already grok it, but you _think_ you don't because it's Emacs, damn it!, it's supposed to be hard and complex and bend the fabric of space and time!

But its essence is actually quite simple: it's a toolbox for all things text. Not a _tool_, mind you; a toolbox. It _contains_ tools. Lots and lots of them. Oh, and it has funny keyboard shortcuts.

So here is Emacs in a nutshell:

1. "find-file" is a function;

2. you can "M-x any-function" to invoke it;

3. you can assign a shortcut like "C-x C-f" to any function;

4. you can define your own functions in the same language Emacs itself is written (i.e., you can really extend Emacs, not only call some simpleton API);

5. you customize Emacs' settings and behaviors by changing some variables ("please highlight the line the point is currently on").

That's pretty much it. Yes, there is a mountain of functions and variables and modes that are complicated and interconnected and you _will_ spend some time configuring everything. But the gist, the essence, the core -- that's it. You've already grokked Emacs. Now you can learn one function at a time and extend your knowledge of it little by little. It doesn't have to be more complicated than that.

The modes? Well, remember, Emacs is a toolbox. Each mode is a tool, specialized in some area of the Great Forest of Text Editing. There's a mode that will help you save keystrokes (yasnippet); there's a mode that will help you write code in the language X (x-mode); there's a mode that will help you open files and buffers easily (ido, anything); there's a mode that will help you with your todos and prose-like text (org-mode).

Regarding org-mode specifically: you can spend weeks using only ONE shortcut, Shift-TAB, and already it will be extremely useful. Then you'll wish for some feature (like adding tags to headlines), and you'll find that it's already implemented. And that pattern will repeat, and repeat, and soon you'll be using lots of advanced features, and you won't even notice, because it'll have become a natural thing.

I hope this makes sense. And, just to be clear: I know a size does not fit all. I did not write this to say "everyone should like Emacs, look, I proved it". This is just my experience with it. I hope it's useful to someone.

Oh, thanks. It's odd, the CLI doesn't even appear here. Had to go to Firefox to see it. Probably some blocking extension getting on the way.

But still there were problems: the CLI did not recognize my keyboard layout. I could not type quotes, so I couldn't even say my name... Too bad, looks cool.

I registered just so I could say this. People keep comparing HTML to Assembly. Come on. HTML is probably the highest level you can get when talking to a computer, at least for the foreseeable future.

I think the more appropriate comparison is to those software generators, or whatever they are called, in which you drag and drop buttons and text fields and have arrows (or something) to convey action.

You don't see a lot of good software made with those, now, do you?

HTML is not Assembly. It's not even C. It's Python, or Ruby.