70
This channel is a feed for r/emacs. @r_channels @reddit2telegram
Use prettierd as a formatter in apheleia
I use emacs v30.2. And within that, [apheleia](https://github.com/radian-software/apheleia) for its reformat-on-save magic.
For Javascript I had been using [prettier](https://github.com/prettier/prettier) as the formatter. Which works, AND, on my old creaky laptop (Windows), it's noticeably slower than on my more powerful workstation at work (Linux). The effect is that after save, there is a about-one-second delay during which the reformat is pending. This can be... distracting.
So I looked into [prettierd](https://github.com/fsouza/prettierd); using an idea cribbed from [eslint_d](https://github.com/mantoni/eslint_d.js), it daemonizes prettier so that it does not have to start each time it runs. The idea is that the first time it runs, it will be slow, as slow as running just prettier. But on subsequent runs, the prettier process is still running in the background, so you don't pay the startup cost. Which makes the whole experience snappier. I didn't measure but it made a clear, substantial improvement for me.
The README for prettier included information for how to set it up for neovim but I didn't find anything for emacs. When I tried I had some trouble, at first, because I didn't have the arguments quite right.
Eventually I found that this worked:
```
(use-package apheleia
:ensure t
:defer t
:config
;; prettierd supports reading options from the command
;; line if you use the --key=value format. It will also read options
;; from .prettierrc , but by default prefers the command-line options.
;; Contents of that file might be: { "parser": "babel-flow", "tabWidth": 2 }
(eval-when-compile (defvar apheleia-formatters))
(if-let* ((prettierd (executable-find "prettierd")))
(setf (alist-get 'prettier-javascript apheleia-formatters)
'("prettierd" filepath "--parser=babel-flow"
(s-join "=" (apheleia-formatters-js-indent "--use-tabs" "--tab-width")))))
)
```
`s-join` is needed there because prettierd does not accept options like `--tab-with 2`; it requires `--tab-width=2` . ([more on this](https://github.com/fsouza/prettierd/issues/982#issuecomment-3850094394))
The above requires that I previously installed prettierd globally like so:
```
npm install -g @fsouza/prettierd
```
Which means you need node and npm installed, etc.
This is working on emacs on Windows 11. I do not use WSL. But because apheleia requires a diff that supports `--rcs` , I need unix utilities to be on PATH. I use git, so conveniently, I can just put the dir for its utilities (`C:\Program Files\Git\usr\bin`) on my PATH.
One notable downside is that prettierd does not provide process management. It does not auto-stop the daemon on idle ([cite](https://github.com/fsouza/prettierd/issues/645)). You must figure out if and when to stop it, and then actually stop it, on your own, if you wish. There will be one prettier running for each directory in which you run apheleia. This may be a significant downside.
The progenitor project, eslint_d, has introduced a feature to kill the underlying eslint process after some period of idleness, by default 15 minutes. prettierd does not have this feature. Yet?
https://redd.it/1qwsgv1
@r_emacs
Remote connection for Emacs
Hi everyone,
I'm releasing the first public beta (v0.5) of ERA (Emacs Remote Agent).
https://github.com/era-emacs-tools/ERA
Just like many of you, I do most of my coding/compute on a cluster for work. This has traditionally been one of Emacs' main weaknesses compared to VS Code. For those of us who want our entire workflow inside Emacs (especially with org-mode), constantly switching tools just to browse remote files without lag is annoying.
Emacs' standard connector, TRAMP, can be painful on high-latency connections because it relies on repetitive shell commands (ls, test, cat) which cause the UI to freeze constantly.
ERA solves this with an architecture similar to VSCode:
- A Rust Backend: A single 5MB binary on the server (no root required) listens on Stdin/Stdout.
- An Async Client: Emacs communicates via JSON-RPC over a single persistent SSH connection.
- Additionally, File IO and Directory listing (Treemacs support!) are asynchronous.
I'd love feedback, especially from other HPC users who struggle with TRAMP lag!
https://redd.it/1qwt79j
@r_emacs
Spent a bit of free time polishing ollama-buddy - github Copilot is now onboard!
I've had a little free time recently (figuring out this baby stuff!) and thought I would spend time revisiting and refining my AI assistant [ollama-buddy](https://github.com/captainflasmr/ollama-buddy)
I've been playing around with agentic coding and keeping up-to-date on the rapid development of the Emacs AI package landscape and I think I have refined in my own mind my idea of what I would like to see in an Emacs AI assistant.
The headline change regarding the latest release of ollama-buddy is GitHub Copilot integration; the rest of the work is about smoothing the UI and simplifying day-to-day use.
What’s new - the Copilot addition (v1.2)
* GitHub Copilot Chat API support via a new file, ollama-buddy-copilot.el, so Copilot models can be used alongside your existing providers.
* Authentication uses GitHub’s device flow (OAuth). No API key required: M-x ollama-buddy-copilot-login opens a browser and guides you through secure authentication.
* Copilot models are identified with a "p:" prefix (for example, p:gpt-4o). The header line shows a "p" indicator when the Copilot provider is loaded so you always know it’s available.
* Copilot access exposes a broad set of models from multiple vendors through the Copilot interface: OpenAI (gpt-4o, gpt-5), Anthropic (claude-sonnet-4, claude-opus-4.5), Google (gemini-2.5-pro), and xAI models.
* Quick usage notes:
1. Ensure you have an active GitHub Copilot subscription.
2. Run M-x ollama-buddy-copilot-login.
3. Enter the device code in your browser at github.com/login/device when prompted.
4. Select a Copilot model with C-c m (e.g., p:gpt-4o).
* Example config to load Copilot support:(use-package ollama-buddy :bind ("C-c o" . ollama-buddy-menu) ("C-c O" . ollama-buddy-transient-menu-wrapper) :config (require 'ollama-buddy-copilot nil t))
Other notable updates in this release series
* **v1.2.1 (2026-02-02)**
* Attachment count indicator on the header line so you get a constant visual reminder that the session has attachments.
* **v1.1.5 (2026-01-31)**
* Global system prompt feature (enabled by default): sets a baseline set of instructions (for example, to prefer plain prose and avoid markdown tables) that is prepended to session-specific system prompts. This helps keep responses consistent across providers and things like malformed markdown tables for example, which seems to be common. There’s a toggle (ollama-buddy-global-system-prompt-enabled) and a quick command to flip it (ollama-buddy-toggle-global-system-prompt), plus a transient-menu entry.
* Consolidated model management: streamlined into a single model management buffer (C-c W) and the welcome screen now points to that buffer for model tasks.
* **v1.1.4 (2026-01-31)**
* Header-line and keybinding cleanup: C-c RET to send prompts (matches gptel, as I feel this seems intuitive), removed a redundant backend indicator, shortened the markdown indicator to "MD", and fixed markdown → org heading conversion to keep structure sane.
* **v1.1.3 (2026-01-31)**
* Chat UX improvements and simplification: added ollama-buddy-auto-scroll (default nil — don’t auto-scroll so you can read while streaming) and ollama-buddy-pulse-response (flashes the response on completion, taking from gptel again, as if there is no autoscrolling it is useful to visually see when the response has completed). Removed the model name coloring feature and related toggles to simplify code and improve org-mode performance.
* **v1.1.2 (2026-01-30)**
* Streamlined welcome screen and model selection, clearer provider indicators in the header line and an improved list of enabled online LLM providers.
https://redd.it/1qvld46
@r_emacs
What would you want from a GNUS successor?
Every few years, I go through the same process of trying GNUS, becoming frustrated by its limitations, and abandoning it. I'm playing around with ideas for a similar package and would like to hear about what you would want from this. As it stands, the design I'm toying with fixes the following frustrations:
* Message processing is asynchronous. Displaying your inbox makes no network calls
* Better back end abstraction. Adding new sources into GNUS is mostly a process of making everything look like NNTP, warts and all. I'm hoping that a more generalised interface will make it easier to add more sources.
* Multiple front ends. If you're not happy with the workflow, it should be reasonably simple to write a new mode to access the data.
Don't get too excited - I'm not the best lisper and this likely won't go anywhere. Still, I would love to hear your thoughts.
https://redd.it/1qwiizn
@r_emacs
(Experimental) Added custom view functionality to org-supertag
https://preview.redd.it/hr7f2pxv2nhg1.jpg?width=519&format=pjpg&auto=webp&s=9520118429a586319b0f7f74340561f710bbd8ab
DSL syntax is used to form the layout, and the data comes from org-supertag's own database.
This picture focuses on the basic components: header/subheader/toolbar/section/columns/stack/card/panel/field/list/table/badge/empty.
What do you think?
https://redd.it/1qwg6uf
@r_emacs
ann: spatial-window
https://github.com/lewang/spatial-window
https://redd.it/1qvfr9q
@r_emacs
quick way to run code.
I am trying to run scripts in emacs, but I have to jump through a lot of hoops to run them vs most IDEs have quick keys that will run it for you. I know there has to be a way to do it in emacs
https://redd.it/1qt6mfe
@r_emacs
A new project manager for elisp packages: Elk
Hey emacsers!
This is probably the most controversial or dubious project, which is possibly why I'm presenting it last. I *am* using it for my new projects, though, so it's at least kinda usable :D
Elk ( https://codeberg.org/Trevoke/elk ) is a new 'project manager'. Why though? We have Cask, Eask, Eldev, and I think at least one more I can't remember the name of. Well, I've tried them all, but I've found that what I really longed for was something a lot more like `rake` - a Ruby version of `make`. Elk is like that: you define tasks with a (hopefully) simple DSL, and then you can run those tasks.
It has support, much like Eldev, for running tasks in a docker container against a particular version of emacs, which is also nice.
How does it work? Well, you can make an `Elkfile` at the project root if you want, which is just lisp code:
;;; Elkfile --- elk configuration
(elk-project
:name "my-package"
:version "1.0.0"
:source-dirs '("lisp/")
:test-dirs '("test/"))
;; Configure built-in tasks
(elk-set 'test-framework 'ert) ; or 'buttercup
(elk-set 'clean-patterns '("*.elc" "*.eln"))
;;; Elkfile ends here
But the key fun part is this:
(elk-task TASKNAME
"Description"
[:depends (TASK1 TASK2 ...)]
[:args (ARG1 ARG2 ...)]
:action (lambda (&rest args) ...))
So one example, running your tests and passing arguments to the test runner:
(elk-task test
"Run tests with optional pattern"
:args (pattern)
:action (lambda (&rest args)
(let ((pattern (plist-get args :pattern)))
(ert-run-tests-batch (or pattern t)))))
And just do this on the CLI:
elk test --pattern=my-test-*
And because everything should be customizable, Elk also supports middleware. Here's a simple example, again from the README, as all of the above is :
;; put this in the Elkfile
(elk-add-middleware
(lambda (task args next-fn)
(message ">>> Starting %s" task)
(funcall next-fn task args)
(message "<<< Finished %s" task)))
And run a task on the CLI:
elk clean
# >>> Starting clean
# elk: Running clean...
# elk: clean completed
# <<< Finished clean
You can configure the test framework :
;; In Elkfile
(elk-set 'test-framework 'buttercup)
But you could also just override the test task.
Anyway, hope y'all try it and enjoy it :D
https://redd.it/1qsz36p
@r_emacs
I tested Claude Code today - And it built a proper agent package in emacs for me.
https://codeberg.org/benwah/emacs-claude-agent
https://redd.it/1qsibsk
@r_emacs
which the recommended package manager to use
I just started with emacs, just started. Would like advice, suggestions on the recommended package manager to used. So far I have come across two straight.el and elpaca.el and then there is the in built one in emac 30
https://redd.it/1qsad6h
@r_emacs
Any good exercises for improving editing and navigation?
I've been using Emacs for a year now and I love it! However, I feel like my editing and navigating in Emacs still feel slower than when I used NeoVim. Are there maybe any good exercises I could do to help do things more efficiently and build muscle memory?
https://redd.it/1qshe91
@r_emacs
Emacs desktop features
Wondering if anyone knows of any good packages that provide features normally handled by a desktop environment. I've been using a scrollable-tiling Wayland compositor for a while now (Niri), and I love it. While there are some very popular add-on shells that work with these types of environments (e.g. DMS), this seems unnecessary for us, since the Emacs daemon is capable of providing most desktop features.
So far, I've found the following:
- bluetooth
- discomfort (for disk management)
- xdg-launcher
- kdeconnect.el
- wallpaper.el (for setting the wallpaper, built-in)
- proced.el (for managing system processes, also built-in)
- dired.el (of course)
There is also a package called "desktop-environment" on Melpa, which sounds promising. But the website that hosts its repo is currently offline.
Anyone have any other examples?
https://redd.it/1qrowsr
@r_emacs
Snippy.el: VSCode/LSP snippet support for Emacs with Yasnippet.
https://github.com/MiniApollo/snippy
https://redd.it/1qrhstj
@r_emacs
Avoiding text overflow in org-mode
I’ve been using basic emacs for a decade with tramp and org-mode.
My programming is mainly in R.
When I’m being lazy sometimes I’ll accidentally print a 100k+ row/column dataframe/list. The problem is this causes wild lag and buffering time to my emacs client and sometimes sends it to an unresponsive mode.
Is there some kind of trick I can use so this doesn’t happen? Maybe some kind of limiter?
The main issue is if I haven’t saved for a few hours I lose all my code if I force it to shutdown. Usually I’ll just suffer the 10+ minutes of parsing… to save my code. That being said that’s on me for not implementing an auto-save. But on the flip side, I also lose all the objects in my R environment too. Which also isn’t ideal..
Any thoughts or simple solutions ?
Thanks !
https://redd.it/1qeprkb
@r_emacs
Experimenting with a faster TRAMP backend using Rust and JSON-RPC
Hi
So tramp uses a shell on the ssh remote connection to do what it does. I thought performance might be improved using an actual RPC implementation, with a server binary running. I chose jsonrpc as emacs has fast native json parsing. The server is written in rust and needs to be copied over on the initial connection. Benchmarks are promising.
https://blog.aheymans.xyz/post/emacs-tramp-rpc/ is my blog post about it.
https://github.com/ArthurHeymans/emacs-tramp-rpc/ is the code.
Let me know what you think!
https://redd.it/1qecqbs
@r_emacs
Make project.el and eglot to recognizes venv
TLDR
Hi, how do I setup virtual environments on python to be automatically pickup by project.el and other project commands?
Ideally I would like to use project.el interface instead of a terminal.
Full Version
Hello everyone,
I was playing around with my emacs in personal projects and it was fine, but I also wanted to use to work.
So I setup the eglot, rassumfrassum and some other niceties I had in my personal config but now I can't seem to use shell commands using the virtual environment (I'm using python)
So, when I type C-x p ! to execute the project-shell-command and I type source .venv/bin/activate, if redo the project-shell-command and type which python, I still get /usr/bin/python
On EAT(Emulate a Terminal) it works fine, but I wanted to use the project commands to do that.
I'm using uv also, and, after adding the pytest, for example, I can't import pytest but I can import fastapi modules.
Does anyone have any clue of what can I do to workaround this situation?
Thank you and cheers!
https://redd.it/1qwshc2
@r_emacs
Emacs ATX meetup today, in few hours.
https://www.meetup.com/emacsatx/events/312922157/
https://redd.it/1qwrh0l
@r_emacs
Interact with agent-shell sessions from your mobile via Slack
https://redd.it/1qv58oq
@r_emacs
Copy and paste issues in Doom Emacs
Hi! When I copy and paste in Doom Emacs I must press several times C-y to paste the content character by character instead of the normal paste result in one operation. I had tried some solutions with AI but they are not working. Please help, this are my first days with Emacs I can just copy and paste is really sad.
https://redd.it/1qvqlvi
@r_emacs
A SimCity clone in Emacs Lisp
https://github.com/vkazanov/elcity
https://redd.it/1qwfjku
@r_emacs
schedule/deadline with timezone conversion on the fly
https://github.com/md-arif-shaikh/tzc/blob/main/tzc-org.el
Suggestions are welcome!
https://redd.it/1qvuut9
@r_emacs
Is dynamic window tiling possible with Doom Emacs?
I've been getting back into Doom Emacs. Mostly because of org-mode. I've been loving it and I don't have too many complaints other than the lack of tiling. Is there anyway to get auto-tiling in Doom Emacs anymore? I saw that the Edwina package had been archived and I wasn't sure if it would still work.
https://redd.it/1qsoagl
@r_emacs
Auto-Adjust Frame Width when Split-Window-Right & Revert on Delete-Window or Delete-Other-Window
I was getting tired of split-window-right requiring me to resize the frame manually. Also needing to use other-window to change focus. Here is some example code that is not production worthy but works for me. Feedback is welcome, suggestions for improving it, even better.
(defun my/enlarge-frame-for-split-right (&rest )
"Enlarge the frame to twice its current character width before splitting right,
but only if the current window spans the full frame width. Also record the original
width and mark that we just enlarged."
(when (= (window-width) (frame-width))
(let ((old-width (frame-width)))
(set-frame-parameter nil 'my-original-width old-width)
(set-frame-parameter nil 'my-just-enlarged t)
(set-frame-width (selected-frame) (* 2 old-width)))))
(defun my/select-new-window-after-split (&rest )
"If we just enlarged the frame for this split, select the new right window."
(when (frame-parameter nil 'my-just-enlarged)
(other-window 1)
(set-frame-parameter nil 'my-just-enlarged nil)))
(defun my/restore-frame-width-on-single-window ()
"If the frame is back to a single window and we previously enlarged it,
restore the original frame width."
(when (and (one-window-p)
(frame-parameter nil 'my-original-width))
(set-frame-width (selected-frame)
(frame-parameter nil 'my-original-width))
(set-frame-parameter nil 'my-original-width nil)))
;; Remove any previous advice/hook to avoid duplicates if re-evaluating
(advice-remove 'split-window-right #'my/enlarge-frame-for-split-right)
(advice-remove 'split-window-right #'my/select-new-window-after-split)
(remove-hook 'window-configuration-change-hook #'my/restore-frame-width-on-single-window)
;; Add the new behavior
(advice-add 'split-window-right :before #'my/enlarge-frame-for-split-right)
(advice-add 'split-window-right :after #'my/select-new-window-after-split)
(add-hook 'window-configuration-change-hook #'my/restore-frame-width-on-single-window)
https://redd.it/1qsd9v0
@r_emacs
dirvish-side how to always show full home directory
I am trying to get dirvish-side to work like a normal tree browser or like neotree where if I open a buffer and then sidebar it should open the full home directory view and navigate to that file position. divish-side opens directory as the main one.
I am on mac and my current config looks like.
;; Dirvish
;;
;; https://github.com/alexluigit/dirvish
(use-package dirvish
:ensure t
:init
(add-to-list 'load-path (expand-file-name "extensions" (file-name-directory (locate-library "dirvish"))))
(require 'dirvish-extras)
(dirvish-override-dired-mode)
:config
(require 'dirvish-side)
(require 'dirvish-subtree)
(require 'dirvish-icons)
(require 'dirvish-ls)
(require 'dirvish-collapse)
(setq dirvish-attributes
(append
;; The order of these attributes is insignificant, they are always
;; displayed in the same position.
'(subtree-state all-the-icons collapse)
;; Other attributes are displayed in the order they appear in this list.
'(git-msg file-modes file-time file-size)))
;;(setq dired-listing-switches
;; "-l --almost-all --human-readable --group-directories-first --no-group")
;; fix mac dired when homebrew is installed
(when-let* ((x (executable-find "gls"))) ; gls supports --dired
(setq insert-directory-program x))
(when-let* ((x (executable-find "gfind"))) ; gfind supports `grep-find-command', `find-dired', et.al.
(setq find-program x))
;;"-b" ; quote special characters, including whitespace (dired doesn't work well without)
;; "--all"
;; "--almost-all" ; eliminates . and ..
(setq dired-listing-switches
(mapconcat
#'identity
'(
"-l"
"--human-readable"
"--group-directories-first"
"--no-group"
) " "))
:bind
(("<f8>" . dirvish-side)
:map dirvish-mode-map
("<mouse-1>" . dirvish-subtree-toggle)
("h" . dirvish-up-directory-single)
("TAB" . dirvish-subtree-toggle)
("l" . dired-find-file))
:hook
;; When dired (dirvish) loads, disable line numbers
(dired-mode . (lambda () (display-line-numbers-mode -1))))
;; Optional: Enable "follow" mode so the sidebar
;; tracks your current buffer's file location
(setq dirvish-side-follow-mode t)
doom emacs dashboard problem
https://redd.it/1qskv3x
@r_emacs
Startup Changes in Emacs 31.1 The "user-lisp" Directory
Emacs prepares a User Lisp directory by default.
If you have a directory named "user-lisp" in your Emacs configuration
directory, then the recursive contents will now be byte-compiled,
scraped for autoload cookies and ensured to be in 'load-path' by
default. You can disable the feature by setting 'user-lisp-auto-scrape'
to nil, or set the 'user-lisp-directory' user option to process any
other directory on your system. You can also invoke the
'prepare-user-lisp' command manually at any time. See the Info node
"(emacs) User Lisp Directory" for more details.
I tested that, its very handy. Just git clone packages or add your own projects in ~/.emacs.d/user-lisp/ and thats it!
Libraries will be auto byte-compiled and auto loaded. No more need for load-path
Yay!
https://redd.it/1qso7ye
@r_emacs
AMP-CLi plugin
Hi Claude and I created this Emacs - AMP CLI integration.
https://github.com/alvarmaciel/amp-emacs
https://redd.it/1qrij4x
@r_emacs
Consult breaking change
Just FYI, a breaking change from 4 days ago changes the way you specify options for the underlying async tools like rg, fd, etc.
Old format:
expression -- -u -L
expression -u -L
-u -L -- expression
--newer 1h
- just escape it \-.
Bending Emacs - Episode 10
https://www.youtube.com/watch?v=R2Ucr3amgGg
https://redd.it/1qei50o
@r_emacs
PSA pdf-tools now supports continuous scrolling (experimental)
I'm not involved in this project, but seeing how continuous scrolling is sometimes discussed in this subreddit, I thought it might be worthwhile to announce the new feature.
Credit goes to the authors of this commit:
https://github.com/vedang/pdf-tools/commit/2603233d2b3814c75c762783327f1fd633f82549
How to enable continuous scrolling:
https://github.com/vedang/pdf-tools?tab=readme-ov-file#continuous-scroll-mode-experimental
It should work out-of-the-box with pdf-tools installed via M-x package-install.
https://redd.it/1qe99jm
@r_emacs