r_emacs | Unsorted

Telegram-канал r_emacs - /r/emacs

70

This channel is a feed for r/emacs. @r_channels @reddit2telegram

Subscribe to a channel

/r/emacs

legmacs (emacs-like written in clojure dialect) compiled to WASM and running in browser
https://matt.parrett.us/let-go-wasmgc/legmacs/index.html

https://redd.it/1x1wes2
@r_emacs

Читать полностью…

/r/emacs

any other solutions ?

## The challenge
Starting buffer:

Hello ,world !


Point: beginning of line

Target buffer:

Hello, world!


## Task
Fix the misplaced spaces around , and ! without retyping the line.

## Rules
- Everything is allowed: vanilla Emacs, Evil, Meow, packages, macros, Elisp, custom keybindings, external tools.
- The result must match the target exactly. Correctness beats brevity.
- One key event per stroke: a chord such as C-a counts as one stroke.
- Disclose any setup, packages, macros, or custom commands your solution requires.
- Count execution keystrokes, not the time you spent configuring Emacs.

## How to submit
Solution:
Setup:
Explanation:

The goal isn't to prove one editing style is superior. It's to discover how many different ways Emacs can solve the same problem.

May the shortest sequence win.

## Solutions

Solution: M-f C-f C-t M-f C-f C-t
Setup: vanilla
Explanation: just moving and transposing

Solution: F3 M-f C-f C-t F4 C-x e
Setup: vanilla
Explanation: simple macro

Solution: M-f C-d C-f SPC C-e C-b C-b C-d
Setup: vanilla
Explanation: delete and write spaces


https://redd.it/1x1s14s
@r_emacs

Читать полностью…

/r/emacs

Magit Fast Mode fast use magit

Magit fast is based on Magit and makes Magit faster.

No heavy diff overhead, while also reducing Git invocations.

https://preview.redd.it/zanfj270aguh1.png?width=649&format=png&auto=webp&s=338764ce600d35f00ef4ad85c73336e9463c10cc

Github Repo: https://github.com/zHaOdANiuu/magit-fast



https://redd.it/1x1ndn4
@r_emacs

Читать полностью…

/r/emacs

Powershell , azure and emacs

Hey all,

I am an emacs user from long ago but now find my day job entails powershell and azure/365 stuff. I have been using vscode for this and I really dislike vscode - constant updates, odd ui choices, json twiddling and so on. Not to mention my muscle memory gets in the way with vscode as well. I am wondering if there are other emacs users out there in this environment and if so, what would you advise me to do if I dump vscode and back to emacs ( magit!!) . How much pain will I incur wiring emacs into an azure environment - posh, python , random text files etc? I can think I might miss some debugging capabilities with powershell but I would like to know what else I would miss. I would gain being really way quicker in editing and general file wrangling, slinging git commands and having a nice distraction free environment that I can change when I need to.

any thoughts you can share would be greatly appreciated

https://redd.it/1x1dh8c
@r_emacs

Читать полностью…

/r/emacs

Better behaviour needed from some kind of electric-pair -mode

There is a mode similar to electric-pair-mode active in my Emacs which isn't working the way I expect. Checking for electric-pair-mode produces nil so it must be some other mode, but describe-mode simply results in too much text to go through.

I strongly suspect it is smartparens-mode though.

What I want it to do when I insert a new opening bracket before an existing opening bracket is to insert the closing bracket on the opposite side of the existing opening bracket , inserted of just after the new opening bracket.

When I insert an opening bracket before () I expect it to result in (()) with the cursor just after the new opening bracket insert of ()().

On that note can anyone suggest a good keymap for the sp-xxxx functions?

https://redd.it/1x13ifv
@r_emacs

Читать полностью…

/r/emacs

Accessing Reddit from Emacs will be impossible after November 13th

Hey r/emacs,

I came across this post a few days ago, which says, among other things:

>we'll stop supporting RSS feeds on November 13, 2026

So, unless I'm missing something, this closes the last hatch through which we could access Reddit from Emacs, even if read-only with the API gone. Now, only AI corps can access our posts without the official UI.

What are your plans for after this? Sadly, r/emacs seems to be the largest Emacs community by far...

https://redd.it/1x11igu
@r_emacs

Читать полностью…

/r/emacs

Emacs on Windows 11 Arm64

I got myself an Asus Zenbook A16 and it has been a really great experience so far. Even though the x86 compatibility is really good, I've been build some of the software I use for ARM so it's all native.

I setup this repo https://github.com/azumafuji/emacs-windows-arm64 to build Emacs for Windows 11 Arm64. Right now it's just building the 31.1 release tag. I'm planning to setup a nightly branch to build the latest version on master, and I'll keep up to date on official releases.

The repo builds a portable zip and an installer for ARM. There is also a `native` version that is optimised for the X2 processor. It doesn't really make a significant performance difference so it will probably get removed.

It was all done with LLM support to build the scripts and build pipeline. No changes the Emacs code except for some patches from MSYS2. It's all in the README. Hope it's helpful for someone.

https://redd.it/1x0w6f2
@r_emacs

Читать полностью…

/r/emacs

NEW emacs32 master branch support scaling for underline, overline... face

Related email discussion: **https://lists.gnu.org/archive/html/emacs-devel/2026-09/msg00514.html**

Github commit: https://github.com/emacs-mirror/emacs/commit/4b76d570d0249d0bd422462361dd627555281ffe

Example

- before

- after




Fast enable feature
---

(setq underline-line-scaling-flag t

overline-line-scaling-flag t

strike-through-line-scaling-flag t)



Test code
---
(progn

(insert

"\\n\\n"

(propertize

"HELLO GNU EMACS"

'font-lock-face

`(:underline (:style wave :color "red")

:overline t

:strike-through t

))))

https://redd.it/1x0sgu7
@r_emacs

Читать полностью…

/r/emacs

need to repeatedly resolve a complete neighboring face here, or could it reuse information the display iterator already knows?

The small cache is a proof of concept, not necessarily the right upstream design. It may be better to reuse existing iterator state or provide a narrower way to answer the box-boundary question.

I would especially welcome feedback on:

* Whether there is existing interval information that makes this cache unnecessary.
* Which face-resolution or invalidation cases this approach might miss.
* Whether a box-specific query would be preferable.
* How best to test glyph and border equivalence before proposing a patch.

**Tested environment:** macOS/ARM64, NS backend, Emacs source revision `fc9cf69afa90990776526a7cf9e693893739fc45`, Org 9.8.7, org-modern 1.15. All core modifications were made in a separate experimental build.

https://redd.it/1x0ou3b
@r_emacs

Читать полностью…

/r/emacs

A small change in xdisp.c reduced allocations by ~42% in a boxed-text workload

**I think there is a performance issue worth investigating in how** xdisp.c **checks box boundaries.** In the path I tested, determining whether a visual neighbor still has a box repeatedly invokes full face resolution, including font-related merging and temporary allocation.

A small, experimental change that bypasses some of these queries reduced vector-cell allocation by approximately **42%** and mean synchronous edit/redraw time by **23–26%** in a dense org-modern workload.

The interesting part is not just that org-modern became faster. **The allocation behavior also reproduces in a plain fundamental-mode buffer, without Org, org-modern, SVGs, overlays, or display replacements.**

This is an experimental core change, not a finished patch or a general “Emacs is 25% faster” claim.

# The question: how much work should a box-boundary check need?

The relevant path in the tested revision is roughly:

get_next_display_element
→ check whether the current element ends a box run
→ face_before_or_after_it_pos
→ face_at_buffer_position
→ merge face/font attributes
→ copy font specifications
→ inspect the resulting face's box state

For the ordinary branch under investigation, the result is used to decide whether the neighboring face has no box and the current box run should end.

That appears to create an opportunity for disproportionate work: **resolving and merging a complete face repeatedly to answer a much narrower boundary question.**

Emacs already has a realized-face cache. This is not a claim that face caching is missing. The issue is that, along this path, attribute merging and temporary allocation can happen **before** the final face-cache lookup.

# This reproduces without org-modern

I started with org-modern because it provides a useful real-world source of densely decorated text. I then reduced the case to repeated text with face properties in fundamental mode.

No Org, font-lock, SVG, overlays, or `display` substitutions were involved.

For 60 forced redraws:

|Configuration|Allocated vector cells|
|:-|:-|
|Colors only, no box|13,320|
|Colors only, with box|13,320|
|Font-related attributes, no box|2,016,360|
|Same font-related attributes, with box|32,188,320|
|Inherited font-related attributes, with box|32,188,320|

The relevant font-attribute cases had the same selected font, visible character count, and line height.

Adding a box increased vector-cell allocation by approximately **16×** in the font-attribute case, while adding a box to the colors-only case did not.

So the finding is specifically about the interaction between **box-boundary checking and font-related face processing**, not that every box is expensive or that face inheritance alone explains the allocation.

“Vector cells” here means cumulative allocation, not vector objects or retained memory.

# Direct counters identify the allocation source

To check whether this was actually the suspected path, I instrumented the native code.

For 30 redraws of the minimal fixture:

|Configuration|Buffer face queries|`copy_font_spec` calls|Allocated vector cells|
|:-|:-|:-|:-|
|Font attributes, no box|51,960|77,490|1,008,630|
|Same font attributes, with box|464,460|1,237,950|16,094,610|

In the boxed case, vector cells allocated directly by `copy_font_spec` accounted for approximately **99.992%** of the measured vector-cell allocation.

More importantly, across three repetitions, the increase in total vector-cell allocation between the unboxed and boxed cases exactly matched the increase attributed to font-spec copying inside the instrumented box-check scope.

That gives a more specific explanation than “decorated buffers allocate a lot”:

Box-boundary checks
→ repeated neighboring-face resolution
→ font-spec copying
→ temporary allocation
→ more GC pressure

These allocation percentages apply to the minimal fixture, not to all Emacs memory use or all org-modern costs.

# A small fast path

Читать полностью…

/r/emacs

GitHub - rjprins/markdown-modern: Modern visual styling for Markdown buffers in Emacs (fork of mark-graf)
https://github.com/rjprins/markdown-modern

https://redd.it/1x0nv9o
@r_emacs

Читать полностью…

/r/emacs

persp-mode-tab-bar: Tab bar for persp-mode / Doom workspaces
https://redd.it/1wznm0f
@r_emacs

Читать полностью…

/r/emacs

close their tickets. It feels like reading a different language (which is already what I was doing). That on top of them talking about their own configs and not Spacemacs.

I wasn't able to understand much besides what it was written in the error. It is finding a symbol with no value, apparently. Some said that it could be a parentheses issue, others that a function is beig called before being declared... I have no idea. What I got is the place where dired-quick-sort is, that might or might not be of some help:

file: \~/spacemacs/.emacs.d/layers/+spacemacs/spacemacs-editing/packages.el

(defun spacemacs-editing/init-dired-quick-sort ()
(use-package dired-quick-sort
:defer t
:init
(define-advice dired-noselect (:before (&rest ) quick-sort-setup)
(let ((dired-quick-sort-suppress-setup-warning 'message))
(dired-quick-sort-setup))
(advice-remove 'dired-noselect 'dired-noselect@quick-sort-setup))
:config
(evil-define-key 'normal dired-mode-map "s" 'dired-quick-sort-transient)
;; prevent `evil-collection' from changing this binding
(add-to-list 'evil-collection-binding-overrides
'(search-or-filter :enabled
(lambda (map-sym
)
(not (eq map-sym 'dired-mode-map)))))))

After writing this wall of text over several days I realised that I could just make *my* config live in a different folder and let Spacemacs be happy on its default folder. That should fix both problems... Would it, though? Would they really be solved or would I just be pretending they are?

I know I could just close Spacemacs and open it back again. I know I can evaluate buffers without leaving Emacs, including running configurations, which is something I try to do most of the time, but not always. Restarting Emacs without resuming layouts are just too many keystrokes, man, and the error would still be there... lingering and waiting to show its ugly face.

As you can already tell... these two issues are dependent on my stubbornness, heh.

If we imagine the last two paragraph were never written... any idea of how to start solving these two puzzles? I know there is a dedicated Spacemacs subreddit but it doesn't look really active and this is the one I frequent the most. Let me know if this isn't the right place to post my question, please.

Thank you for reading.

TLDR: Wanted to have parallel configs. Changed Spacemacs installation folder. Two errors are present now. One when opening Dired and the other while restarting Spacemacs. Need some guidance to identify why these errors are ocurring.

https://redd.it/1wz5ko6
@r_emacs

Читать полностью…

/r/emacs

stripspace.el - Make Emacs auto remove trailing whitespace before saving a buffer, with a options to preserve the cursor column, normalize indentation, and restrict whitespace cleanup to clean buffers [Release 1.0.6]
https://github.com/jamescherti/stripspace.el

https://redd.it/1wzdm4f
@r_emacs

Читать полностью…

/r/emacs

Getting emacs to cohabitate with termux
/r/termux/comments/1wzax8p/getting_emacs_to_cohabitate_with_termux/

https://redd.it/1wzaxha
@r_emacs

Читать полностью…

/r/emacs

Ayu themes for Emacs: night, dusk and day, built from the official palette

I ported all three Ayu flavours to Emacs: ayu-night, ayu-dusk and ayu-day.

Colours are the exact official ones from ayu-theme/ayu-colors (resolved with the ayu npm package), not approximations; syntax follows the same scope mapping ayutheme.com renders its previews with.
\~2200 faces per flavour: core UI, font-lock and tree-sitter, org, magit/diff, corfu/vertico/ivy, treemacs/nerd-icons, terminals, mail, plus the long tail.
Defaults reproduce the original Ayu look — contrast is opt-in (ayu-themes-contrasted-syntax and friends), and M-x ayu-themes-cycle flips night -> dusk -> day.
Emacs 29.1+.

Repo: https://github.com/1buran/ayu-emacs-theme

Demos (dusk / night / day):

[Dusk](https://i.imgur.com/99zjKco.gif)
Night
[Day](https://i.imgur.com/8UA4EIY.gif)

https://i.redd.it/nelkjciguguh1.gif

[Dusk](
https://i.redd.it/s7vwjahcuguh1.gif)

(use-package ayu-themes
:straight (:type git :host github :repo "1buran/ayu-emacs-theme"
:files ("ayu-themes.el" "ayu-
-theme.el")))

Then (load-theme 'ayu-night t).

Not on MELPA yet. Feedback welcome — especially on the day flavour, which is soft by design in Ayu.

https://redd.it/1x1pejl
@r_emacs

Читать полностью…

/r/emacs

Rust bindings for Emacs dynamic modules support canvas_data API

https://redd.it/1x1ph5i
@r_emacs

Читать полностью…

/r/emacs

Doom Themes is clobbering the ability to set the background of completions-highlight face.

This is in relation to my previous submission - How can I change the colour of the highlight line in M-x for the light ef-themes?

The problem starts which a doom theme is selected, and after that the background colour of the selected completion item can't be changed.

The completions-highlight face is inherited from modus-themes-completion-selected.

I thought it was a problem with ef-themes but the problem seems to come from doom-themes. It appears to override the customization functions, or it changes the way the completion list is generated, bypassing its established variables.

https://ibb.co/8g7Q0g00


It remains that way until Emacs is restarted, after it which it goes to the saved settings so long as a doom theme is not loaded.

Emacs is 32.0.50, ef-themes is 2.2.1 and modus themes is 20261005.1000

Emac 28 and 31 also exhibit the problem

Can anyone check if the problem is present on their system.

https://redd.it/1x1jktt
@r_emacs

Читать полностью…

/r/emacs

What are my options for browsing org-agenda on Android phones?

Over the years I have noticed

Orgzly - Development slowed?

Orgzly Revived - Fork of above with more updates

Organice - Better funded, supported?

Mova - No images of the UI

https://redd.it/1x180kj
@r_emacs

Читать полностью…

/r/emacs

Is there some way of showing your relative position in a buffer with scroll-bar-mode turned off, probably with some plugin?



https://redd.it/1x13yyh
@r_emacs

Читать полностью…

/r/emacs

Deeper layers of Org Mode laziness explained
https://youtube.com/watch?v=DrlMLgc5r2E&si=F7zqY9G0iZGoIXK5

https://redd.it/1x0ylyr
@r_emacs

Читать полностью…

/r/emacs

Hyperbole HyRolo: Search, Retrieve and Insert Records, Not Lines
https://www.chiply.dev/post-hyperbole-hyrolo

https://redd.it/1x0rtn3
@r_emacs

Читать полностью…

/r/emacs

Fixing the tree-sitter syntax highlighting bug in Emacs 31+ indirect buffers (The Emacs maintainers will not fix it, so I did)
https://www.jamescherti.com/restore-emacs-tree-sitter-syntax-highlighting-in-indirect-buffers/

https://redd.it/1x0q2dc
@r_emacs

Читать полностью…

/r/emacs

makes a measurable difference

The experimental change is deliberately narrow.

It remembers a previously resolved buffer interval and whether the resolved neighboring face has a box. At the dedicated box-end check, a valid cache hit confirming that the neighbor still has a box can bypass the full face lookup.

Otherwise, it uses the original path.

It does not remove borders, simplify the requested font attributes, replace text with images, or return a cached face ID to arbitrary callers. Strings and display-vector paths are not bypassed.

The cache checks window/buffer identity, modification counters, narrowing bounds, and face-change flags, and is invalidated on iterator initialization.

**The actual bypass requires only a small change to the existing path.** That is why I think the underlying behavior deserves attention: a narrowly scoped change can eliminate a substantial amount of work without intentionally reducing the decorations being displayed.

I do not mean that a production-quality fix is necessarily simple. Most of the remaining difficulty is proving that the shortcut is correct across redisplay’s edge cases.

# Results in the org-modern workload

The final comparison used 1,000 dense Org content groups, with baseline and fast-path modes in the same instrumented executable.

Each mode ran in a fresh GUI process, serially, with mode order rotated across three repetitions. GC remained enabled.

An edit sample includes a modification and restoration, each followed by redisplay.

|Metric|Baseline|Experimental fast path|
|:-|:-|:-|
|Mean body-edit pair|15.60 ms|11.86 ms|
|Mean timestamp-edit pair|15.11 ms|11.59 ms|
|Mean forced redraw|6.99 ms|5.20 ms|

Across these phases:

* Buffer face queries fell by approximately **26.5%**.
* Font-spec copying fell by approximately **42.3%**.
* Vector-cell allocation fell by **41.6–42.2%**.
* Paired mean-time reductions ranged from **23% to 26%**.

These are synchronous operation timings, not physical input-to-screen latency or FPS.

**The long tail remains.** Editing p95 stayed around 49 ms. The patch reduced work and GC frequency; it did not eliminate all pauses.

# How much correctness checking has been done?

Before actually skipping queries, I ran a verification mode that made the cache prediction and then executed the original lookup for comparison.

Crucially, this verification mode used the fast path’s cache-maintenance behavior: it did not refresh the cache on hits that would have skipped the original query.

Across 18 scenarios, it compared approximately **25.54 million cache hits** without a box-state mismatch. The scenarios included bidi, composition, overlays, display replacements, invisibility, edits, face changes, remapping, narrowing, two windows, and scrolling.

Window ranges, visible-text pixel dimensions, and sampled character geometry also agreed between modes. Deliberately incorrect predictions were detected by the verification harness.

However:

* Repeated cache hits are not millions of independent test cases.
* Geometry checks do not establish pixel-perfect border rendering.
* Multi-frame, different-buffer, dynamic-face, and long-running interactive cases need more coverage.
* A few small query-count residuals remain unexplained and are retained in the results.
* An uninstrumented performance comparison is still needed.

# One correction from the investigation

An earlier experiment appeared to improve allocation by flattening face inheritance. That conclusion was wrong: the flattening happened before org-modern updated the parent face’s box attribute, so the supposedly equivalent configuration was missing a border.

Preserving the box removed that apparent benefit.

That mistake helped isolate the actual trigger, but the inheritance-flattening explanation has been withdrawn. The fast-path results above come from a separate experiment that retains the requested box and font attributes.

# Why I am posting this

My main question is about **the internal redisplay path**, rather than how to optimize org-modern’s Lisp code:

>Does box-boundary detection

Читать полностью…

/r/emacs

supersonic.el Music Player v0.6.0 Update (added UPnP support)
https://youtu.be/Gnq1EQaMn-4

https://redd.it/1x0nurd
@r_emacs

Читать полностью…

/r/emacs

mu4e-send-later: A "Send Later" functionality for mu4e
https://github.com/Jotham-LEC/mu4e-send-later

https://redd.it/1wzpsdz
@r_emacs

Читать полностью…

/r/emacs

org-retroclock: Log CLOCK entries retrospectively without starting a timer
https://github.com/Jotham-LEC/org-retroclock

https://redd.it/1wzmx40
@r_emacs

Читать полностью…

/r/emacs

Two independent configs, two dependent errors (--init-directory, Dired & Spacemacs)

TLDR at the end

I have been learning web developement and decided to use Emacs as my main editor. The Emacs distribubion I started to use was Spacemacs because I wanted something preconfigured to get a better idea of what can be done and how other people use Emacs. I am not familiar enough with many terms and topics yet to make my own working config. It also saved me some time and let me start using the editor rightaway after some quick reading.

I am new to programming in general so after some challenges I was able to make lsp work. I really don't know if it is working properly because the idea of language servers is also new to me. It should be working with the default config that Spacemacs uses, I think. But I am lagging while I use it. Badly. I was doing some basic coding in very small files and it slows down really bad. It gives me useful suggestions and I get documentation while I mouseover or on the minibuffer.. but this prompt me to start my own config from scratch.

I didn't want to get rid of Spacemacs because I use it daily, so I started to find a way to have more than one config simultaneously. I found an option introduced in Emacs 29, `init-directory`. To do what I wanted I needed two configs: Spacemacs and the vanilla one. I started to search how to install Spacemacs in a different folder, because it uses the by default. I did the following:

\- I cloned Spacemacs using git clone `https://github.com/syl20bnr/spacemacs.git` ~/spacemacs/.emacs.d , which is a different folder.

\- I created an alias for it to start it from the command line with its own init-directory: alias spacemacs='setsid emacs --init-directory ~/spacemacs/.emacs.d'.

It worked, for the most part. The Spacemacs configurations and all its layers initiate when I type the alias in the command line. If I just type `emacs`, it uses my new config from the now almost empty `\~emacs.d` directory, where a lonely `init.el` sits.

The issues I have when using the Spacemacs config are two:

1. When I try using the spacemacs/restart-emacs-resume-layouts command bound to M-m q r , Spacemacs closes but then it opens the the Emacs with the default (new) configuration and the following message in the minibuffer:

Unknown option --resume-layouts

2. Every time I open Dired to navigate I get the following error:

Error (use-package): dired-quick-sort/:config: Symbol s value as variable is void: evil-collection-binding-overrides

I never encountered these errors before. The first one is easier for me to understand. My spacemacs/restart-emacs-resume-layouts function is sending the command to open Emacs with the the default configuration because it expects all the Spacemacs files to be there but they are not there anymore. Following the function to get to its definition, I found the following function next to several others related to restarting flags:

file: \~/spacemacs/.emacs.d/layers/+spacemacs/spacemacs-navigation/funcs.el

(defun spacemacs/restart-emacs-resume-layouts (&optional args)
"Restart emacs and resume layouts."
(interactive)
(spacemacs/restart-emacs (cons "--resume-layouts" args)))

I might be mistaken but I thought that adding "spacemacs" to the "--resume-layouts" string would then send the command "spacemacs --resume-layouts" to... wherever it was going (guessing the command line) and that because spacemacs is an alias, it would then add its `--init-directory` plus, the "--resume-layouts" string that was already there. It doesn't work. I think it becomes emacs spacemacs --resume-layouts somehow... as if it was concatenating. I don't know then, where to change that "first" emacs to the spacemacs alias.

I tried finding errors similar to the second one because I have been unable to find exactly the same one, but the explanations are confusing and you can clearly tell that the guys communicating don't need to explain everything to each other to finish the conversation and

Читать полностью…

/r/emacs

Bringing micro-timers, checklist budgeting, and monotasking focus to Org-mode (org-focus-hud)
/r/orgmode/comments/1wz7qiq/bringing_microtimers_checklist_budgeting_and/

https://redd.it/1wz7qq6
@r_emacs

Читать полностью…

/r/emacs

A problem with tabs auto alignment

https://redd.it/1wz8rbl
@r_emacs

Читать полностью…
Subscribe to a channel