HNHacker News
TopNewBestAskShowJobs

karthink

161 karma · joined November 27, 2014

submissionscomments
karthink··on CRIU, a project to implement checkpoint/restore functionality for Linux
I am one of the authors, should have mentioned. It's not part of Org yet, but should be some time this year.
karthink··on CRIU, a project to implement checkpoint/restore functionality for Linux
> The killer app I'm trying to apply this to is LaTeX, so that I can write math notes in Emacs, incrementally, without visible latency.

See texpresso [1] for one solution that does something like this with the LaTeX process.

Another, more conservative solution is the upcoming changes to Org mode's LaTeX previews [2] which can preview live as you type, with no Emacs input lag (Demos [3,4]).

[1] https://github.com/let-def/texpresso

[2] https://abode.karthinks.com/org-latex-preview/

[3] http://tinyurl.com/olp-auto-1

[4] https://tinyurl.com/ms2ksthc

karthink··on Helix-gpui: A simple GUI for the Helix editor
Emacs' keymap system is fully modal by design. This state machine is why it's possible to fully implement evil-mode (and many other modal editing UIs, like boon, lispy etc) quite easily on top.
karthink··on Git as a debugging tool
This feature is built into Emacs, no Magit needed. It's the vc-region-history command, bound to `C-x v h` by default. It works across all version control systems Emacs supports, not just git.
karthink··on Claude 3 model family
Just added it to gptel.
karthink··on Claude 3 model family
Just added it to gptel. (No image support though, it's a text-only LLM client.)
karthink··on TextEditors.org – A website about every known software Text Editor
> Tabs contain splits (as opposed to splits containing tabs like VS Code).

Emacs allows for both (tab-bar-mode vs tab-line-mode).

karthink··on Emacs-copilot: Large language model code completion for Emacs
Glad it's useful.
karthink··on Emacs-copilot: Large language model code completion for Emacs
> Getting input into LLM various ways (region, buffer, file, inline prompt), and then outputting the result various ways (append at point, overwrite region, put in new buffer, etc).

gptel is designed to do this. It also tries to provide the same interface to local LLMs (via ollama, GPT4All etc) and remote services (ChatGPT, Gemini, Kagi, etc).

karthink··on Cursorless is alien magic from the future
> I see an Emacs package coming lol.

Emacs is pretty good in the other direction (can type, can't see) thanks to Emacspeak.

But it's going to be a while before Emacs can catch up in this domain. The display engine can't handle cursorless-style notation, and the tree-sitter integration is not mature yet.

Source: I've tried.

karthink··on Emacs 29.1
This has been addressed in Emacs 29.

From the NEWS file:

Emacs is now capable of editing files with very long lines. The display of long lines has been optimized, and Emacs should no longer choke when a buffer on display contains long lines.

karthink··on Emacs 29 is nigh
> My new job is all in Julia

Where is this, if you don't mind my asking?

karthink··on Emacs 28.2
> Are we talking about real optimizations?

Yes. The new fixes don't work by turning off features like so-long-mode does. And they remove the long lines penalty almost completely.

karthink··on My goal of closing 10% of Emacs bugs (2020)
> I HAVE A STRING HERE JUST FUCKING TELL ME WHAT TO DO WITH IT

M-x shortdoc-display-group string

karthink··on Emacs Timeline
> I'm not sure how that compares to VSCode's capability.

Not favorably. Perhaps there's a magic combination of SSH and Tramp settings that can make the experience lag free, but I can't find it. VSCode's remote editing was setup-free and close to seamless when I tried it.

Tramp has support for many, many more remote protocols though.

karthink··on Emacs’s Builtin Elisp Cheat Sheet
> I was looking for an evaluation list, see `edebug-visit-eval-list` (`E`) and `edebug-update-eval-list` (`C-c C-u`) c:

Outside of edebug I've used `trace-function` and `watch-variable` in the past for this.

karthink··on Emacs for Professionals
The start up time of emacs isn't slow if you know what you're doing. I have a 14,000 line init.el and about 355,000 lines of code across ~150 installed packages. Emacs starts in 0.2-0.3 seconds. Not instant but practically there's no difference.

The downside of autoloading (lazy loading) all libraries is that there's a hitch when I first open a "heavy" elisp library. A PDF, an org mode document or something that launches an LSP server, say. But if I launch emacs to edit a bash script or a config file the speed is indistinguishable from vim.

karthink··on Emacs 27 Antinews
I prefer info to manual pages and even readthedocs websites by a large margin. Emacs' info reader is great, it keeps track of your visited info nodes as a tree, generates custom indexes for you and allows you to navigate by visit history, node name, index entry and more.

The only downside is that you can't embed images in info, so you end up lots of ASCII art flowcharts ava box drawings. But that's true of man pages as well.

karthink··on I draw figures for my mathematical lecture notes using Inkscape (2019)
Emacs integration for the OP's style of inkscape usage[1]

My fork with personalizations[2]

Org-mode integration for Krita[3] and Xournal[4]

[1] https://github.com/foxfriday/ink [2] https://github.com/karthink/ink [3] https://github.com/lepisma/org-krita [4] https://gitlab.com/vherrmann/org-xournalpp

karthink··on Avy Can Do Anything
Thanks. The blog is generated by Hugo from org using ox-hugo[1]. The sidebar is part of the Hugo Cactus theme[2], which I modified a bit for my use.

The "flow charts" were made in Inkscape. No custom (ya)snippets are in use. (My Emacs configuration is linked to on the home page of the blog, but there isn't anything particularly interesting about it.)

[1] https://ox-hugo.scripter.co/

[2] https://themes.gohugo.io/themes/hugo-theme-cactus/

karthink··on The Emacs-28 release branch has been created
Tree-sitter integration (through the fast C layer) is in its early stages, I wouldn't expect it until Emacs 29 or later.

There is a lisp-based tree sitter package that works for now, but there are no plans to add it to the core.

karthink··on Pen, a GPL Copilot for Emacs
> With some add-ons you can apparently eg find undoable changes for only some region of a buffer, etc.

This is built into Emacs (no add-ons needed). Calling undo with a region selected undoes changes only in that region.

karthink··on Helix: a post-modern modal text editor
The buffer was not being edited when the replacement was shown to be happening. The plugin anzu uses overlays[1] to show the text being replaced and the replacements.

[1]: https://www.gnu.org/software/emacs/manual/html_node/elisp/Ov...

karthink··on Helix: a post-modern modal text editor
C-x C-SPC (pop-global-mark) will work across buffers.
karthink··on Helix: a post-modern modal text editor
Jumping "forward" is sort of built into Emacs with C-x C-SPC, pop-global-mark.

The objective and this command are fairly but not completely aligned, so it may require multiple presses of C-x C-SPC. To be clear, you only need to press C-SPC after the first invocation to repeat the command.

karthink··on Helix: a post-modern modal text editor
I'm not sure there's a surefire way of jumping back with your C-x commands that's built into Emacs, but here are two options:

C-x C-SPC will pop the global mark which, depending on what you've done in the buffer you're visiting, can pop you right back to where you started, functioning as the equivalent of M-,.

C-x b RET (C-x b with no input) should take you back to the most recently used buffer, which will usually be the buffer you started from.

Not built in: It's also fairly trivial to write some defadvice that stores your point (pre-jump) to a register, so you can jump back to the register with one key.

karthink··on Helix: a post-modern modal text editor
'df.' is simulated with M-z (zap-to-char). There's also a zap-up-to-char command that corresponds to 'dt.', but it's not bound to anything by default.

There's no doubt that it's all ad hoc though. 'd/something' is doable with C-s something RET C-w, but it's already getting tedious in comparison.

karthink··on My Life in E-Ink
It has a crop-margins feature for reading PDFs that (for most documents) makes the text size slightly larger than it would be printed on letter sized paper. It's pretty seamless. For two column documents there's a "quarters" reading mode.

It's not a great experience for a PDF with no margins and a complicated layout (like some magazines.)

karthink··on My Life in E-Ink
I own the BOOX Note 2, it's an android tablet with some E-Ink friendly modifications. It's the best electronic reading experience I've ever had:

- It's 10.3", perfect for reading PDFs like scientific papers without being too large to carry around.

- The included reader is stellar, with special modes for reading PDFs, comicbooks, etc.

- The included note-taking app is pretty good and fully featured. It integrates with the reader and there's a side-by-side mode.

- It supports every open format I've tried: PDFs, DJVU, epub, mobi and more. (Haven't tried PS.)

- I can scribble on all document types, including ebooks.

- I can install apps from the app store. In particular this means I can read my Kindle library and Wallabag feed, and...

- with Syncthing syncing is set and forget. When I download a PDF or book on my computer, I simply pick up the tablet and start reading it. Any notes I make are synced back to my laptop.

- Of course, the above is in addition to the standard E-Ink features you'd expect: It lasts for weeks on a charge, the reading experience in bright sunlight is fantastic, it's lighter than an iPad, zero eye strain, etc.

I installed only the software I need for reading and syncing, but there's a lot more you could do with it since the play store and F-droid are available. You can use it as an external monitor, for instance.

karthink··on The Animated Guide to Emacs Paredit
An easier way to deal with unbalanced delimiters without toggling paredit-mode is to use C-q, quoted-insert. C-q ) inserts a literal ) where regular ) is bound to paredit-close-round.

Quoted insert is generally useful when you want to enter a specific character that is bound to something other than self-insert, such as a literal newline in a regex pattern.

← PreviousPage 2 of 2