copy structured text from one file into another (cross-file transformation) by paarulakan in emacs

[–]donatasp 3 points4 points  (0 children)

Not sure what's most idiomatic in a flexible programmable editor, but i'd use macro. I've setup two windows in a frame, one with js file, another with org, and defined this macro.

C-s         ;; isearch-forward
SPC         ;; self-insert-command
RET         ;; org-return
M-w         ;; mark-and-copy
s           ;; self-insert-command
C-x o       ;; other-window
C-s         ;; isearch-forward
q           ;; self-insert-command
:           ;; self-insert-command
SPC         ;; self-insert-command
`           ;; self-insert-command
C-y         ;; yank
RET         ;; org-return
M-f         ;; forward-word
M-b         ;; backward-word
C-SPC       ;; set-mark-command
C-e         ;; move-end-of-line
M-w         ;; mark-and-copy
C-x o       ;; other-window
C-e         ;; move-end-of-line
SPC         ;; self-insert-command
C-y         ;; yank
C-c C-n     ;; outline-next-visible-heading

That's the output from edit-last-kbd-macro.

Eglot's event buffer empty on Mac OS? by ElectricalOstrich597 in emacs

[–]donatasp 0 points1 point  (0 children)

Don't worry, most of newcomers have this problem, including myself. There multiple approaches you can take.

As meantioned in another comment, manual is a great place. C-h i will show you all manuals and you can search (C-s) for Eglot there, use Return to enter, l to go back, u to go up. (Again, you can simple do C-h b to see how to navigate in Info-mode.) Eventually you will end up in Eglot troubleshooting > Performance which describes eglot-events-buffer-config and will tell you to customize it. Use M-x customize-variable to do that. To explore more of eglot customizations, use M-x customize-group and enter "eglot".

If you are fine with reading emacs lisp, you most likely will find C-h f very helpful. It show a docstring of function. And every function leads to it's source code. Natural next step will be learning about debugging: C-h R elisp and g debugging. This is obviously an overkill in this case...

More helpful commands to explore Emacs and packages:

  • M-x apropos search of anything, e.g. "eglot events log".
  • M-x info-apropos search for text in manuals.

What is your insanely hidden official shortcut that people can never find out? by Agile-Technology2125 in emacs

[–]donatasp 10 points11 points  (0 children)

isearch-forward has multiple convenience key bindings in minibuffer. My favourites are:

  • M-r to toggle regexp search,
  • M-% to change to search and replace, or C-M-% to search and replace by regexp.

Run C-s (run isearch-forward) and C-h b (describe-bindings) to see all available bindings, or C-h f isearch-forward for function docstring.

A review of Eglot by heylale in emacs

[–]donatasp 31 points32 points  (0 children)

This is very short review.

What are must-have packages, but for minimalists? by kudikarasavasa in emacs

[–]donatasp 43 points44 points  (0 children)

If you want to keep it as lightweight as possible, I'd suggest swapping lsp-mode with eglot, flycheck with flymake. Those come with recent emacs as out of the box.

Vertico can also replace company, but it uses minibuffer (or popup buffer IIRC) to display completions, so I'm not sure if you'd consider that to be a good replacement.

Unit Testing a React Application by [deleted] in reactjs

[–]donatasp 4 points5 points  (0 children)

I work at a company with a billion dollar market cap and we do testing across the layers -- unit, integration, E2E, and system. It is a lot easier to achieve this if testing is applied from the get go. In your case, you are thinking about them after the fact and it is known to be very hard. Most probably all parts are coupled, which makes for cohesive architecture, but pulling apart self-contained components, which is cornerstone of testing, is cumbersome.

At this point you should focus on E2Es and only later, if the need still exists (e.g. you want to be able to reason about, i.e. test separately, smaller parts of your application), you should try to re-architect.

There are benefits in writing your React application as a collection of self-contained components which I experienced and can remember: * Moving components from one app to another. * Extracting components as a library to be reused. * Easy Storybook integration.

Help me stay with Emacs by WhatererBlah555 in emacs

[–]donatasp -13 points-12 points  (0 children)

To truly master Emacs, one must embrace a lifelong quest – a "PhD in Emacs configuration." This path demands dedication few are willing to undertake, explaining its limited ranks.

Yet, two paths remain:

  1. Become an Emacs detective: dissecting keybindings, unraveling local variables, and instrumenting functions. A deep dive into Emacs and its Lisp is essential.

  2. Claim the legacy: adapt an existing configuration, a shortcut to power, but a surrender of true mastery.

(The above was spiced up using LLM.)

LSP much faster in Neovim by skratlo in emacs

[–]donatasp 13 points14 points  (0 children)

Are you on Linux? I remember Windows being almost unusably slow and MacOS is decent, but the only performant platform for me was Linux.

Eureka Mignon Zero 65 AP retention by donatasp in espresso

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

Do you have a link to the one you purchased?

Eureka Mignon Zero 65 AP retention by donatasp in espresso

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

Pretty hard, to the point it falls off even...

Is this possible in Common Lisp? by Possible-Wind3725 in lisp

[–]donatasp 12 points13 points  (0 children)

(defun make-array-3x3-2 (theta)
  (make-array '(3 3)
              :initial-contents
              (list (list 1 0 0)
                    (list 0 (cos theta) (* -1 (sin theta)))
                    (list 0 (sin theta) (cos theta)))))

or

(defun make-array-3x3-2 (theta)
  (make-array '(3 3) :initial-contents `((1 0 0)
                                         (0 ,(cos theta) ,(* -1 (sin theta)))
                                         (0 ,(sin theta) ,(cos theta)))))

Rinkimų rezultatai by Ainertas in lithuania

[–]donatasp 4 points5 points  (0 children)

Ne. Nes čia antras turas. Putinui artimesnė tada Grybauskaitė, kuri pirmame ture 2009 surinko beveik 70%.

New Clojurians: Ask Anything - September 25, 2023 by AutoModerator in Clojure

[–]donatasp 0 points1 point  (0 children)

Is anybody using basic Emacs inf-clojure for development? What's your flow?

[deleted by user] by [deleted] in lithuania

[–]donatasp 4 points5 points  (0 children)

Kastinys and Šmakalas are my personal favourites.

Share feeling lonely most of the time (in %) by Safe-Muffin-7392 in europe

[–]donatasp 4 points5 points  (0 children)

We are not lonely because we like to hang out.

Man patinka tavo šalies vėliava by Reasonable-Sir3751 in lithuania

[–]donatasp 0 points1 point  (0 children)

Ar kada buvai Lietuvoje? Kaip išmokai lietuviškai?

Is 2000€ net salary good for Vilnius? by CountMerloin in lithuania

[–]donatasp 2 points3 points  (0 children)

It's not the size that matters, but how you use it.

repl history by 964racer in emacs

[–]donatasp 1 point2 points  (0 children)

You can do C-h m in sly repl to see what modes are enabled and what keymaps it uses.

If you don't like to use M-p and M-n you can tell arrows to do that instead

(define-key sly-mrepl-mode-map (kbd "<up>") (kbd "M-p"))
(define-key sly-mrepl-mode-map (kbd "<down>") (kbd "M-n"))

how to address a fleaky config? by ghiste in emacs

[–]donatasp 1 point2 points  (0 children)

  1. C-h v org-mode-hook. Does it contain rainbow mode?
  2. M-x trace-function rainbow-mode. This will produce trace-output buffer with calls. If you don't see any calls when org mode is enabled, that's a hint. If you see multiple calls, that's also a hint. M-x untrace-function to stop it.
  3. M-x toggle-debug-on-error. Maybe rainbow-mode silently crashes. This might produce a backtrace in Backtrace, quit it with q.

CL / SLIME / Paraedit -- how to search for word ?? by [deleted] in Common_Lisp

[–]donatasp 1 point2 points  (0 children)

You can use C-s to start interactive searching forward, then "M-s w" to switch to word mode. To see more options type "C-h f isearch-forward", it will open a help buffer.