Midnight Pub

midnight and emacs

~mysliceoftheweb

Greetings all. Does anybody use emacs / elpher to view midnight? If so how do you login to midnight using it?


tatterdemalion

You can't post from Gemini (elpher), and you don't need to be logged in to read. You can log in and post with eww; I've confirmed that it works.

Probably someone (cough) ought to write a Midnight posting function for Emacs.

reply

moonsheep

I don't think you can log in with a gemini browser (gemini can't maintain session state by design. I think you can use client certificates for maintining server-side state but whatever). You have to use the web interface for that.

By the way, it seems it's possible to post using a simple shell script. Please refer to

The manual

You could probably hack something together in elisp with

request.el

~bartender, some hydric acid for me please!

reply

ew

Howdy, I have tried the script mentioned in the manual, but failed. I could find the required cookie content, but something was amiss. So I would be interested, too, how to get this rolling.

~bartender? A lemonade please, it has been so hot today. Thanks!

reply

moonsheep

Hmm, I tried replying to your comment and got the following error:

server error: pq: insert or update on table "replies" violates foreign key constraint "replies_post_id_fkey"

I'm going to capture the request created when I post this reply to see what a proper reply looks like.

EDIT: Ahh, my bad, I used -r instead of -t, I completely misread the man page.

reply

moonsheep

If you're reading this, it worked!

reply

orchard

No offence to anyone, so please take my question as genuine curiosity. How do you deal with those keybinds on emacs? Like i have tried multiple times to switch to it but it just doesn’t have the simplicity of vim. I really want to learn it but I always get stuck on the idea of time invested vs returns. Could someone enlighten me on this?

and ~bartender, a glass of water please.

reply

littlejohn
How do you deal with those keybinds on emacs?

I've no idea, my muscles do it on their own :-). There is some logic to some of the mappings but realistically not to the level of composability vi has.

I think this whole editor efficiency thing is overrated. I learned emacs pretty much by accident, it could've easily been vi. Tbh I think that once you've learned an editor, the only reason you should learn another editor is if the one you're already using is suddenly wiped out of existence, or it doesn't run on the platform you're using, or some similar catastrophe that makes the editor you used unavailable. In my case, if UltraEdit had been available for FreeBSD back when I learned emacs, there's a good chance I would've never learned emacs.

Not that I don't enjoy mock editor wars, those are fun as long as in they're good humour :-D.

reply

tatterdemalion

The default keybinds are okay, but I've got used to them over the last 30 years. The basic movement commands are control + mnemonic. Global commands are on C-x something, major mode commands are on C-c something, if you have a reasonable completion framework installed, you can treat M-x like a command palette with fuzzy matching. Which-key-mode gives you hints for every prefix binding.

It's not totally unreasonable to use CUA-mode if you're used to those, or Evil if you're used to vim.

reply

ew

Hello ~orchard,

I'm a long time emacs user (since 1993), and I use vi almost daily, too. "vi" that is, not "vim". I cannot agree, that vi key bindings are "simpler". They are different. And I think, this is important: vi and emacs come from different points of view of the computing world back then, when they were created. To compare one to the other is difficult.

A resource that I find helpful is "Mastering Emacs" by Mickey Peterson

https://www.masteringemacs.org/

I never groked emacs-lisp, but I do use selectrum,consult and friends for completion, magit to talk to git, tramp to connect to remote machines, org-mode, org-roam, mu4e, elpher, and a few language modes. Since recently I also use the modus themes plus jetbrains mono fonts. My init.el uses 38 packages as I type this. So I consider myself a moderate user of elisp packages.

Yes it takes time to master such a tool. But I never had to learn another editor after emacs. Entering text in a web form (like now) is not really comfortable, imho. If you really want to explore emacs, then start using it for a small set of tasks. Do not try to set up /everything/ at day one.

~bartender? Another lemonade, please.

reply

moonsheep

That's the thing about emacs, it's a very mediocre text editor that comes with a great operating system :p

99% of emacs is knowing your way around elisp, which is just a generic dynamically typed lisp that happens to be very good at plain text processing. It doesn't have good default keybinds because 1) when those keybinds where first chosen keyboards were very different from today (search "space cadet keyboard") and 2) you are not supposed to use the defaults at all, the whole point is that you write your own text editor with the facilities emacs provides you.

You might be thinking: elisp isn't a great language, and if you're going to be writing everything from scratch, you could just as well be writing the entire text editor from scratch with a better language right? Well yes- but then you're going to be missing out on all the things that other people have written. Countless packages on elpa and melpa that do anything and everything you could possibly imagine: magit, lsp-mode, smartparens, yasnippet, and the list goes ever on and on.

You might also be thinking: this all sounds absurdly time-consuming. Why would I go through all this trouble when I could just be using a text editor with sane defaults someone else has written? Well the hard truth is that you will have to invest a lot of time into emacs if you're really willing to use it. Make no mistake, there are a few emacs distributions that come preconfigured with lots of great packages (like spacemacs, doom, frontmacs and a few others) and some people might argue that using them misses the point of emacs entirely.

In summary, use whatever you prefer and best fits your needs. If you're not a fan of having to load 20 megabytes from disk every time you boot up your editor and would rather use vim, then so be it (albeit kakoune is better than vim! ;)

reply

mieum

evil-mode all the things + general.el for defining custom bindings. I am a long-time vim user, but do use emacs for things like org-mode. I prefer modal editing and vi-style navigation to emacs' defaults, which feel especially cumbersome if typing on a phone in termux for example. However, I don't attempt to completely vimify emacs and remap all the bindings. I tend to use the defaults of each mode and only remap when stuff is overridden by evil.

That said, like anything, delving into emacs takes time. Whether or not it is worth the effort depends on your needs really. For me, it has been worth it to make use of versatile tooling such as org-mode.

reply

moonsheep

It's always nice to find another user of the almighty orgmode in the wild!

reply