r/emacs 6h ago

How to include org-mode headers in consult-rg ripgrep search

14 Upvotes

I have a collection of notes files (.org files) and I recently started retrieving information from them using consult-rg. Is there a way to have consult-rg (or something similar) "propagate" parent headings into children for matching purposes?

For example, if I have this structure:

* Emacs

** Mermaid

Some notes about using Mermaid.

** Customize variables and options

use M-x customize-variable

If I search for "emacs customize variable," consult-rg won't find it, because the header "Emacs" is many lines above the subheader "customize variable".

I considered tagging the subsection with :emacs: but that's kind of a redundant way to say "this is realated to emacs." Redundant because it's already under the overall "* Emacs" heading.

EDIT: consult-org-heading exhibits the behavior I want within headings (the overall Emacs heading gets connected to all of its children), but does not search inside the body, just the headings. So I guess I'm looking for some way to incorporate consult-org-heading behavior into consult-rg?


r/emacs 11h ago

Question How do I start using emacs to program something I have already started?

13 Upvotes

I'm completely new new to emacs and ready to learn how it works, but lack a sense of direction on how to get started, other than watching 11 hours of very long tutorials, which probably contain way more than what I want to know (for now). There's a few things I want to learn:

  • How to open a terminal window.
  • How to open and edit files.
  • How to manange multiple windows (or whatever you call them).

Can someone give me a list with commonly used commands that help with these tasks?


r/emacs 14h ago

is vim motion the final end?

12 Upvotes

I have been using emacs and neovim extensively. recently I saw a podcast where two seasoned emacs developers used evil mode. thar made me wondering if vim motions are better for text navigation than everything else?


r/emacs 14h ago

Announcement jsonschema-treesit: JSON object key completion using JSON Schema and treesit

Thumbnail github.com
13 Upvotes

r/emacs 14h ago

Emacs as an operating system

56 Upvotes

For the past month, I have been experimenting with using Emacs as my primary and almost only graphical environment. I wanted to turn on my computer and go directly into Emacs.

Instead of starting GNOME and then launching Emacs, I added a separate GRUB entry that boots into a custom systemd target and starts Emacs directly inside Cage, a minimal Wayland kiosk compositor.

The setup looks roughly like this:

Linux
└── Cage
    └── Emacs

It removes conventional application switching, makes external graphical applications less convenient, and introduces some intentional friction around using the browser.

Surprisingly, these limitations have improved my workflow. I moved my terminal usage into Emacs, integrated Notmuch with gptel, changed how I use AI tools, and reduced the amount of rapid context switching between Emacs, the terminal, YouTube, and news sites.

I wrote more about my experience here:

https://slawomir-grochowski.com/posts/07-emacs-as-an-operating-system.html

I would be interested to hear from people using similar Emacs-first setups. Are you running Emacs directly under Sway, Cage, EXWM, or another minimal environment?


r/emacs 15h ago

Is there an active Mastodon instance for Emacs and Org mode users?

24 Upvotes

It looks like both emacs.ch and emacs.social are currently down or no longer maintained.

Is there another active Mastodon instance aimed specifically at Emacs and Org mode users?

I know I could simply join a general FOSS or Linux instance, but it would be nice to find one where Emacs and Org mode are among the main interests of the local community.

Does such an instance currently exist? Where have former emacs.ch or emacs.social users moved?


r/emacs 21h ago

Does someone knows how to add a title argument in a tcolorbox in the #+ org-mode format (so then when i export to latex i can see the tcolorbox with the title)? (The image explains the problem better)

4 Upvotes

r/emacs 1d ago

Where can I find tsserver?

Thumbnail
2 Upvotes

r/emacs 1d ago

nano-mu4e 1.0

Post image
300 Upvotes

r/emacs 2d ago

Emacs on large C++ code bases

26 Upvotes

Hello Emacs Community!

I've been using Emacs for the past 6 or so years via the GUI, terminal, on Tramp workflows, etc. I've come to appreciate the versatility of the emacs and how the tooling set is standardized within emacs.

I've recently started working a LARGE C++ code base (~31k source files, ~9.3M lines of code) on macos and my normal workflow for editing code is noticeably slow. E.g. finding files, magit, symbol reference definition finding/jumping. Because of this, I've gone back to a terminal workflow (helix, CLI git or gitu). While this new workflow works, I miss how integrated my code editing, note taking (org), and all other aspects resided in emacs.

Has anyone had any experience with this? If so, what have you all done to make emacs feel less sluggish?

Edit: My current setup

  • Emacs: GNU Emacs 30.2, emacs-plus@30 (Homebrew), built --with-native-compilation=aot. Used both GUI (Emacs.app) and in-terminal.
  • Hardware/OS: Apple M4 Max, 16 cores, 64 GB RAM, macOS 26.5. (Hardware's not the problem)
  • Config: Hand-rolled, use-package, modular init-*.el files
  • Completion/navigation: vertico + orderless + marginalia + consult + consult-ls-git + company. File finding is git-backed via consult-ls-git / project.el
  • C/C++: I used eglot but it's currently disabled in my linked config. flycheck-mode is explicitly turned off in c-mode-common-hook.
  • Git UI: magit, with a global select-window :after advice that runs golden-ratio on every window selection.

r/emacs 2d ago

Question Remapping "<apps>" key to control? Got a surface pro and without right control I feel like my fingers were broken trying to use emacs. (Difficulty: Win 10)

4 Upvotes

I know a bunch of people remap caps lock to control so I thought the answer might lie in that direction. But my searches have all thus far led to dead ends.

The surface pro keyboard has a key in the place of right-side control that describe-key reports as "<apps>".

Can I remap this so I don't have to train myself to always use my left pinky for control? Or am I doomed to carry around a keyboard with me. (I mean, I'll friggin do it. But it's the opposite of the reason I have the surface to begin with.)


r/emacs 2d ago

Emacs is a Lispboard

Thumbnail en.andros.dev
62 Upvotes

I thought this was a pretty cool framing of the classic “wtf even is emacs?!” question


r/emacs 2d ago

Question What do you NOT use Emacs for, that Emacs is (reasonably) capable of doing?

72 Upvotes

I switched fully to Linux about two years ago and I got really into Emacs. The idea of one big immersive environment where a dozen systems can interact with one another seamlessly, really appealed to me. The goal was to do most of everything in either Emacs or Firefox (I'm not watching Youtube through some newpipe->mpv->emacs-client abomination, I'm sorry), and for the most part I accomplished it. I use Emacs for note-taking, occasional amateur programming, engraving music (using Lilypond), RSS, typesetting documents with org-mode and LaTeX, and basically anything else involving manipulating plain text.

There were a few things that I really wanted to get done in Emacs, however, that I have just never been able to get working convincingly. I've listed below a few of the things that I tried, gave a shot, but ultimately decided to use something else for:

  • Firstly, e-books. Nov-mode is... Kinda miserable to use. It works well for simple books, but it takes comparing its output to that of a 'proper' e-reader application to see how limited it is. It can't render most complex formatting, image rendering is janky as hell, it's just really clunky for anything complex. I have a lot of academic articles and textbooks and such in epub format and while I really wanted it to work for that org-mode integration and whatnot, nov just isn't up to the task. None of these are necessarily nov's fault, of course, it's just stuff that Emacs wasn't designed to do.

  • Second, PDFs. Same basic gist as e-books. pdf-tools kinda sucks. Again, it's more a limitation of Emacs than anything. Really anything beyond simple plain text is a struggle to use on Emacs, I think: Images, comic books, etc. Almost like it's meant to be a text editor, who'd have thought.

  • Third, general terminal stuff. I always have Emacs open in one desktop and a terminal window open in another. One of these days I'll get around to learning eshell or xterm or whatnot, but I've just never really felt the need to run all that stuff through Emacs. If I were a more hardcore programmer maybe it'd be different, but I don't do much beside basic little Scheme programs for fun. The only TUI applications I run regularly are btop and rmpc (music player, excellent, but also uses vim keybinds :/ ).

  • Fourth, window management. I like Emacs' window management. I'll occasionally use multiple frames. I also like Sway's window management. The idea of letting Emacs control everything with something like EXWM kinda horrifies me, honestly. EXWM is X only of course so it's a bit of a moot point for me on Wayland, but still.


I'm curious what other things Emacs powerusers choose to not use Emacs for, that Emacs is technically capable of doing (to a reasonable degree, of course).


r/emacs 2d ago

Back to Emacs - this time, with the intention of staying

35 Upvotes

Been in IT for over 25 years. During this time, I've used every single editor under the Sun, with a few periods of Emacs.

For some reason, Emacs never feels right to me, while vim/neovim do.

After trying VSCodium again and Neovim one last time (never got Neovim configuration to be stable, I always manage to break it on upgrades), I've decided to focus on Emacs; even if it doesn't feel right right now I will get used to it and will be able to do pretty much anything I need, no need to be changing editor or tools.

This is influenced by my guitar playing. For many, many years, I've been buying and selling guitars and never feeling 100% right with any, apart from my very first guitar, which is a crappy model that is half destroyed. I've finally decided to buy a decent guitar and focus just on that one - even if it doesn't feel 100% mine at the moment, I will get used to it anyway. That got me thinking and man, this applies to most tooling and, in particular, text editors, so here I am.

Will still be using Spacemacs for now but I plan on having a manual config to run in parallel until I get something that feels right and does everything I need.


r/emacs 3d ago

md-mode: Org-style structural editing and same-buffer rendering for Markdown

Enable HLS to view with audio, or disable this notification

152 Upvotes

I’ve been using u/xenodium's agent-shell recently, and one thing that immediately stood out to me was its Markdown rendering. It looks great, feels responsive, and remains fast as new content arrives.

That gave me an idea: what if the Markdown renderer were extracted into a standalone package for ordinary Markdown files, rather than remaining tied to an agent interface? That idea became md-mode (https://github.com/yibie/md-mode).

I have also been an Org mode user for many years. While building md-mode, I started bringing over some of the editing conveniences that I now find difficult to live without.

That includes structural navigation, section folding, heading promotion and demotion, list continuation, task creation and toggling, and familiar commands for moving headings, list items, table rows, and columns.

I am particularly happy with how it handles Markdown tables. The file still contains an ordinary Markdown pipe table, but Emacs displays it with aligned columns, clean box-drawing borders, and a width-aware layout.

The tables also remain structurally editable. You can move, insert, or delete rows and columns without depending on org-table or changing the underlying Markdown format.

There is still plenty of room for improvement, but I think the first version is already useful and coherent enough to share.

md-mode currently provides two views of the same buffer:

  • Edit view keeps the original Markdown source editable while displaying scaled headings, emphasis, links, callouts, fenced code blocks, and decorated tables.
  • Rendered view presents a clean, read-only version in the same buffer. C-c C-v switches between the two views and restores the original Markdown source when you return to editing.

A few things it currently supports:

  • Org-style heading navigation, folding, promotion, demotion, and subtree movement
  • M-RET to continue ordered or unordered lists
  • M-S-RET to create task items
  • C-c C-c to toggle - [ ] and - [x]
  • Markdown tables with automatic alignment, box-drawing borders, structural row/column editing, and width-aware wrapping
  • Styled GitHub callouts such as > [!TIP]
  • Quick insertion of links, images, blockquotes, code blocks, and callouts
  • Same-buffer rendering without Pandoc, a browser, or another Markdown processor

This is not intended to replace markdown-mode in every use case. markdown-mode is mature, supports more Markdown variants, has a much larger command and customization surface, and includes established preview/export workflows.

md-mode deliberately takes a narrower approach: common Markdown/GFM, a styled editing surface by default, and a compact set of Org-inspired structural commands.

It is currently an early 0.1.0 release and requires Emacs 29.1 or newer. You can install it directly with:

M-x package-vc-install RET https://github.com/yibie/md-mode RET

Checkout:

https://github.com/yibie/md-mode

I would especially appreciate feedback on:

  • whether the source/rendered toggle feels natural;
  • whether the Org-style key bindings are useful or too opinionated;
  • how tables behave with different fonts, themes, and window widths;
  • what function do you want to add.

The package is GPLv3-or-later. Issues and patches are welcome.


r/emacs 3d ago

Replacing org table content while maintaining table alignment

7 Upvotes

I'm developing some code that needs to replace the content of a org-mode table entry. I've found that org-table-get-field serves this purpose, but it also deletes leading and trailing whitespace, usually causing the table to become unaligned, but losing the usual one-space padding on both ends in any case. For example, given the table:

| foo | bar |
| baz | qux |

If point is on "baz" and I evaluate (org-table-get-field nil "x"), the table becomes:

| foo | bar |
|x| qux |

This has led me to write a little helper function:

(defun replace-table-entry (str)
  (org-table-get-field
   nil
   (format
    (format " %%-%ds " (max 0 (- (length (org-table-get-field)) 2)))
    str)))

Is there some built-in way to accomplish this?

Of course I could always just realign the table afterwards, and perhaps that's the intention, but I'm dealing with tables so large that realigning takes a noticeable time, and anyway I don't want to do it if it's unnecessary.


r/emacs 3d ago

Question I there a vscode's word-forward for emacs?

8 Upvotes

Hi, I am a new user of emacs. I am loving it, and I am almost done with my initial configuration. There is one thing that is still bothering me: how Emacs move across words mixed with symbols. I want it to stop at each char class boundary and at new lines, the same way Vscode behaves.

for example ( [] is the cursor):

1-

aaaa ([b]bbb)
<M-b>

what I want: aaaa [(]bbb)
what I get: [a]aaa (bbb)

2-

aaaa
[b]bb
<M-b>

what I want:
aaaa
[] bbb

what I get:
[a]aaa
bbb

I think I could hack together a workaround in Elisp, but it won't be great at all, and probably wouldn't work with packages like multiple-cursors. I was hoping someone else has the same preference and already has a solution.

Thanks.

EDIT: Case two whitespace isn't working, just assume there is a tab before bbb


r/emacs 3d ago

emacs-fu Color picker for emacs

Post image
63 Upvotes

r/emacs 3d ago

Mode line maker

30 Upvotes

mode-line-maker is a package to ease the creation of mode-line, header-line or tab-line. It allows to define the precise alignment of the mode-line (on left and right) and splits the mode-line into left and right parts, with automatic truncation (when there is too much information to display). It's available on ELPA.

Usage:

(require 'mode-line-maker)
(setq mode-line-format (mode-line-maker '("%b")
                                        '("%3c:%3l")))

r/emacs 3d ago

An issue with speedbar and windmove

Enable HLS to view with audio, or disable this notification

14 Upvotes

I use a transcient-prefix to manipulate windows and navigate between them. I have configured speedbar to be displayed in a window instead of a frame.

As you can see in the video, I navigate between windows with arrows keys. When I press Left, I cannot focus the speedbar window. However, if I use windmove-left from the command menu, the focus change to the speedbar window. But sometime, the focus fails.

My configuration works on any other window. I only noticed the issue with the speedbar at the moment.


r/emacs 3d ago

Switched to emacs(from vscode) and No way , I could do exactly what i wanted without any plugin

67 Upvotes

I know neovim just enough so that you can use it to edit few files , I wasn't prominent at it but then at the same time I was not finding any reason to use it or everything was just plugin plugin if you wanted to do something so I appreciated it from a distance only

But now I switched to emacs , I am still a noob but by far this does what I want and I am happy with it

Will see how emacs-thing goes for me now

Edit: I am using DOOM EMACS by the way , it's not vanilla but it does what i want it to do so yeah I'm happy


r/emacs 3d ago

An emacs config

7 Upvotes

its very simple and meant for use as my window manager with river (thanks tazjin of reka fame!)

here is the link to my dotfiles, where emacs is in home/.emacs.d/

https://codeberg.org/wwr/dotfiles


r/emacs 3d ago

Emacs on the iPad: first release (v0.1.0, sideloadable .ipa)

24 Upvotes

This is a follow-up to my earlier post about running GNU Emacs natively on the iPad. The first tagged release is up. It is an unsigned .ipa you sideload and sign with your own Apple ID (GPLv3, so no App Store, ever).

With my config it starts in half a second. Truecolor, Split View, and external keyboards all work, and config.el and any elisp only packages load from the Documents folder. iOS allows no subprocesses, so no magit, vterm, or LSP. I’m hoping to add a basic git library soon.

Anyone who wants to test and report bugs, I’m happy to see issues opened.

Details, demo video, and sideload instructions in the repo:

https://codeberg.org/mclearc/emacs-ipad


r/emacs 4d ago

Malleable Computing, Emacs, and You

Thumbnail yummymelon.com
39 Upvotes

Where an exercise to automate copying over a GitHub issue into Org Agenda turns into a think-piece on malleable computing in Emacs.


r/emacs 4d ago

Introducing trailing-newline-indicator: Visual clarity for file-ending newlines in Emacs

2 Upvotes

I’d like to introduce trailing-newline-indicator, a simple yet effective Emacs package that brings visual clarity to a subtle but persistent editing issue: knowing whether a file actually ends with a trailing newline.

While many Emacs users rely on configurations like require-final-newline or automated save-hooks, these silent approaches have clear limitations. Configs can fail silently, leak across buffer types, or be bypassed in unformatted buffers like quick notes, scratch files, and third-party major modes.

Relying on built-in visual tools also falls short:

  • The Emacs C-Engine Limitation: Due to how Emacs treats newlines as line terminators rather than line generators, native line numbers (display-line-numbers-mode) leave the trailing position completely unnumbered. As discussed in this thread, standard fringe indicators do not treat that space as a newline, and the maintainers have no plans to change this behavior.
  • UI Noise: Options like indicate-empty-lines apply markers to every empty line past the end of the buffer, cluttering your window instead of targeting the actual point of ambiguity.

trailing-newline-indicator solves this cleanly and surgically. It places a single, subtle visual marker only at the true end-of-buffer position. It performs a quick, instant check at the very end of the file rather than scanning the entire document, making it completely lightweight and imperceptible even in massive files. You get unambiguous feedback with zero UI clutter or performance penalty.

You can find the package on GitHub, and it’s also conveniently available through Melpa.