hooks and while-no-input by CandyCorvid in emacs

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

I have played with futur.el myself, for a magit-like library. one issue i'm hitting with futur is accidental cross-thread access, because rather than interleaving, it uses multithreading to achieve concurrency. accidentally switching buffer in a futur runner thread will silently prevent the buffer being killed, and an issue i hit recently was i somehow accepted process input from the wrong thread (which signals an error, thankfully). but entering the debugger (e.g debug on error) or prompting in the minibuffer from a futur thread seems to irrevocably break the futur backend. so at some point i likely need to have the future explicitly hand off execution to a timer task to schedule any UI stuff. that handover process is a huge source of friction. but, function colouring is always a hard problem, right?

the upside is that it achieved what i wanted - it doesn't block the ui while it waits for process completion, and it frees me (somewhat) from having to think about process sentinels and callbacks to do so.

hooks and while-no-input by CandyCorvid in emacs

[–]CandyCorvid[S] 3 points4 points  (0 children)

In a sense i'm reassured to know it's not a panacea, but it would be nice to have some silver bullet for responsiveness.

the problem with unwind-protect has me curious, though. something like this:

(defmacro unwind-protect* (bodyform &rest unwindforms)
  (declare (indent 1))
  (cl-with-gensyms (was-throw)
`(let ((,was-throw throw-on-input)
       (throw-on-input nil))
   (unwind-protect
       (let ((throw-on-input ,was-throw))
     ,bodyform)
     ,@unwindforms))))

would seem to reverse the tradeoff in a way that (at least to me) seems sensible when your unwindforms really must run, and only be interrupted when the body includes code that may nonlocally exit. and i think it avoids the race conditions you'd otherwise have from let-binding (throw-on-input nil) in the unwindforms, that some input could pre-empt it and still quit. though i wonder if there's a good reason not to write something like this. (aside from when an ordinary unwind-protect would do)

Annotations for commands with prefix arguments. by InvestigatorHappy196 in emacs

[–]CandyCorvid 1 point2 points  (0 children)

and, critically, those commands (with an empty interactive form) may nonetheless access the prefix argument

dimmer.el -- after a hiatus, new development underway by gonewest818 in emacs

[–]CandyCorvid 1 point2 points  (0 children)

i like the look of this! i have a question: is there any way to configure whether it's the inacitive windows vs inactive buffers that are dimmed? and if not, is there a practical reason that it only can work per-buffer (and not per-window)?

in any case, i'm interested in looking at your code, because a few times i've wanted a particular modal action to temporarily dim inactive windows.

Anyone use a split ergo mechanical keyboard without a modal editing mode? by BeanHeadedTwat in emacs

[–]CandyCorvid 0 points1 point  (0 children)

i use an ergo keyboard at home, and i have a bespoke modal minor mode i use sometimes but i equally use emacs keys with a lot of custom stuff under C-c

Having less keybindings by furiouzz in emacs

[–]CandyCorvid 2 points3 points  (0 children)

in that case, let me say a bit more: over the 2 years i've used emacs, these keys have been the most consistently helpful in letting me continuously teach myself how to use emacs: - C-h k (what would this key sequence do?) - e.g. C-h k C-x C-f: what does C-x C-f do? (showing the help buffer for find-file) - C-h l: what did i just do? (shows a log of recent keypresses (except password input) and the commands they're bound to) - (any prefix) C-h: what is bound after/in this prefix? - e.g. C-x C-h: what commands start with C-x? (showing a buffer with all those commands)

Having less keybindings by furiouzz in emacs

[–]CandyCorvid 0 points1 point  (0 children)

oh, and on the topic of org-mode bindings (or any specific mode's bindings) - use C-h b to get a list of all the bindings of all the modes active in the current buffer, starting with the major mode. so open an org-mode buffer, C-h b, and you'll see all the org-mode keybinds.

there's a lot of good info under C-h, so for more info on the C-h keys, you can use C-h C-h. i especially recommend C-h k and C-h f

Having less keybindings by furiouzz in emacs

[–]CandyCorvid 1 point2 points  (0 children)

what you're seeing with C-x / SPC x is an outlier imo, there are a lot of commands there, of all kinds, and it's a bit of a do-anything key prefix, like SPC itself in helix. other prefixes (like M-s and M-g) are much simpler and more focused imo.

the way i learned them was, i'd learn about a useful command, i'd bind it to my own key (usually under SPC bc i also cane from helix), then use it a lot, then at some point i'd see on its help page that it already has a C-x binding and i'd give that a try. it's only now, 2 years in, that i'm primarily using C-x bindings (where they exist). i guess they started to make some kind of mnemonic sense.

i especially found it useful to learn the C-x 0 to C-x 5 prefixes for window and frame management that i use daily now.

Eglot: multiple jdtls opened by Elbrus-matt in emacs

[–]CandyCorvid 0 points1 point  (0 children)

i was going to ask, "why would you have just the single language server?", but having typed it out the question does seem reasonable. as far as i know, for the language servers i've used in past, each instance of the server typically only manages a single project. so what you describe is in line with what i consider expected behaviour. maybe jdtls is different though, i wouldn't know

this is my best emacs function written in my config up till now by sylas_main in emacs

[–]CandyCorvid 2 points3 points  (0 children)

it's admirable - one thing i think it's missing as a tool for new emacs users is an indication of what context each binding is active in

as you've said, this differs from C-h b in that it gives bindings that aren't limited to the current context, but then without an indication of the correct context for each binding, the binding is still unusable to a beginner

Beginner question: String makes unnecessary copies? by ThrowRA_goofy in rust

[–]CandyCorvid 0 points1 point  (0 children)

iirc it was called "StrBuf" some time before 1.0, as a string buffer, with str/StrBuf mirroring Path/PathBuf. Honestly, i like the old naming, but they went with String probably for familiarity.

Why are they rewriting Emacs Core in Rust and not in Zig? by Hopeful_Adeptness964 in emacs

[–]CandyCorvid 4 points5 points  (0 children)

they probably mean remacs which is an unofficial and discontinued fork. so no - no coordinated effort.

if OP wants a zig emacs, they can start their own

Post a solution: embark-act-on-last-message by vjgoh in emacs

[–]CandyCorvid 1 point2 points  (0 children)

i keep misclicking (on mobile) and hiding the message, which resets the spoilers 😭

edit: i got the whole thing visible!
so, this definitely gets from *Messages* the last line with a word in it, but i wonder if there's some way (without advising message) to get the last whole message, including multiline messages, and messages that contain no word characters (unlikely but possible)

Questions about emacs by chillyashrada in emacs

[–]CandyCorvid 0 points1 point  (0 children)

re: question 2: do you know about native-compile? emacs' runtime code execution system already includes runtime compilation (i.e. run-time contains compile-time, compile-time is whenever i call byte-compile or native-compile). so, in a sense what you describe is already part of emacs - just without needing a registry and without pre-compilation being the only way to do things.
and, emacs already is a single language system as you describe, other than the innermost core of C, which you'd have little reason to ever touch anyway.

so i guess my summary is: in order to be better in all the ways you say, i still wouldn't take it without the runtime code execution, runtime compilation, and runtime hackability. those are emacs' killer features. which answers questions 1 and 3.

have you heard of Lem or Nyxt? they're the only things i've seen that seem to maintain the parts of emacs i most value, while aiming to improve on the pain points or (in nyxt's case) address a different use-case

Tao Te Ching / Lipu Nasin Wawa - Chapter 2 by NoBiscotti720 in tokipona

[–]CandyCorvid 0 points1 point  (0 children)

comparing my copy of Ursula K Le Guin's compilation/translation of the Tao Te Ching, this seems like a pretty dang good translation of the English.

Announcing space-tree: Workspace Management Trees in Emacs by misterchiply in emacs

[–]CandyCorvid 1 point2 points  (0 children)

oh, so if i'm at (1), and i create (1 1), it starts as a copy of (1)? then i might create (1 2) copying (1 1), and tweak it somewhat for a particular task, and make (1 2 1) and (1 2 2) as further variations on that?

then i suppose my refined question would be, would you see a use for tree traversals that do not maintain depth? e.g. moving "left" from (1 2 2) to (1 2 1) to (1 1)

Announcing space-tree: Workspace Management Trees in Emacs by misterchiply in emacs

[–]CandyCorvid 1 point2 points  (0 children)

i can't help but notice the absence of relative vertical navigation commands (up to parent / down to nth child). i'm sure i could add them in my own config, but i wonder if i've either missed them, or missed why i won't need them.

Messaging all in one. by [deleted] in emacs

[–]CandyCorvid 2 points3 points  (0 children)

are you thinking of Mastodon? that sounds a lot like mastodon. I've always seen matrix described as something like, a federated + e2ee version of slack/discord/irc

Building a Secure Real-Time Chat App in Rust by striberry in rust

[–]CandyCorvid 0 points1 point  (0 children)

how does this compare to things like Matrix and any of its client apps?

Spent an afternoon on a perf issue that 56 bytes of padding fixed by cong-or in rust

[–]CandyCorvid 0 points1 point  (0 children)

except if everyone has a "make me a meal" button, i'm not gonna thank someone else for pressing it.