TGViewer
Channel Public Channel
/r/emacs

/r/emacs

@r_emacs

This channel is a feed for r/emacs.

@r_channels
@reddit2telegram
Subscribers
79
Photos
1.2K
Videos
109
Links
28K
Recent Posts 20 shown
Post #28604 4
Can I use GNU Emacs + Org-Mode to log a repeated activity on android

Hello All, I am a absolute beginner to emacs. I am looking to log a repeated daily activity. The daily activity has 9 to 10 different parameters with fixed values. Is there a way to accomplish this with emacs. Is it possible to have drop down style selection of these values?

This activity can be considered as a daily personal survey which presents the questions and we can select the answer from the drop down. If possible to export as a csv for analysis using spreadsheet software.

https://redd.it/1wr9rhr
@r_emacs
Reddit From the emacs community on Reddit Explore this post and more from the emacs community
Post #28597 15
Post #28596 14
Emacs: clangd and lsp-mode -> diagnostic lag while typing, and an on-demand solution

I've been investigating an annoying interaction between Emacs/lsp-mode and clangd when working on larger C++ files.

The larger the source file becomes, the more noticeable the diagnostic lag gets while editing. Emacs itself remains responsive, but diagnostics can appear several seconds after an edit and at some point/code length stop updating completely.

After looking at what is happening, the behavior seems to be: while typing, the document changes continuously, in every keystroke. A diagnostic request that was started for the previous state of the file (previous keystroke), becomes obsolete as soon as another character is inserted, so it can be cancelled and a new diagnostic calculation started for the new state. With sufficiently large translation units/code length, this can result in a cycle of:

edit

↓

diagnostic calculation

↓

another edit

↓

previous request becomes obsolete/cancelled

↓

new diagnostic calculation

↓

another edit

↓

repeat...

So the issue isn't that clangd is inherently slow at calculating diagnostics (is not). Rather, continuously recalculating diagnostics in each keystroke while the source is being modified can become increasingly expensive as the translation unit/code length grows.

The interesting part is what happens when diagnostics are disabled while editing.

I now use diagnostics on demand instead of continuously:

(global-set-key (kbd "C-c d") 'lsp-diagnostics-mode)

This makes C-c d toggle diagnostics on and off.

My normal workflow is therefore:

write code

↓

diagnostics OFF

C-c d

↓

diagnostics ON

↓

inspect errors/warnings

C-c d

↓

diagnostics OFF

↓

continue working

The important difference is that when I enable diagnostics deliberately, the file is in a final/stable state. clangd doesn't have to keep throwing away diagnostic calculations because another keystroke immediately changed the document. The diagnostics appear essentially instantly in this situation regardless of the file/code size.

This has actually turned out to be a workflow I prefer even independently of the lag. Diagnostics are useful, but I don't necessarily want them continuously displayed over my code while I'm actively writing. Often I'm working on an intentionally incomplete intermediate state, so warnings and errors appearing after every keystroke are mostly visual noise.

I'm curious whether other Emacs + lsp-mode + clangd users see the same behavior with larger C++ files, and whether there is a more fundamental way in lsp-mode/clangd to avoid the repeated diagnostic recalculation while still editing.

https://redd.it/1wpuk2f
@r_emacs
Reddit From the emacs community on Reddit Explore this post and more from the emacs community
Post #28590 13
Gnus truncates Mail subject lines, but not RSS subject lines

Which, actually, indicates to me that something is up with nnimap or nnmail, or fetching the subject of the message, not something wrong with gnus itself. It seems to truncate at 100 characters.

```
(setq gnus-summary-line-format "%U%R %z%-6i [%-18,18f %-16,16&user-date;] [%2t] %B%-150s\n")
```

The subject part of the line is set to 150, but I've also left it unbounded, to no effect, I always get exactly 100 characters.

USUALLY this is no issue, but given that sometimes you get a lot of boiler-plate preamble on a subject line, it can be the case that the last part of the subject is actually important. Is there anywhere that I can change this? `customize-apropos` and hunting through `gnus-mail`, `nnmail`, `nnimap`, 'gnus summary` etc. didn't turn anything up.

https://redd.it/1wohqxr
@r_emacs
Reddit From the emacs community on Reddit Explore this post and more from the emacs community
Post #28589 13
Anyone here doing Java + Maven in Emacs? Building a zero-config LSP and could use help

I'm a Neovim user, and I've been building my own Java language server based on the JDK compiler and Maven.

I built it because setting up JDTLS on the Maven projects I work on day to day was a pain — I read through older r/emacs threads and saw pretty mixed results too, some people happy, others fighting memory and setup issues. So I tried a different idea: instead of guessing the project layout from the pom files, my server reads what was captured by the Maven build, so it works without much config.

It's working well for me in Neovim now, and I'm considering bring it to Emacs — but I have to be honest: I'm not an Emacs user myself, and so far I've only been prototyping the Emacs client with the help of AI agents. To make it genuinely good, I'd really need a hand from people who actually use Emacs day to day.

So I'm partly checking whether there's interest and partly hoping to find collaborators. If a zero-config Java + Maven setup for Emacs sounds useful, let me know in the comments — I'll share the repo and a short Neovim demo.

Thank you for reading.

https://redd.it/1wobvid
@r_emacs
Reddit From the emacs community on Reddit Explore this post and more from the emacs community
Post #28588 12
A small feature—not sure if it's useful, but it's a lot of fun

Hello friends! I am currently learning Emacs and Elisp, and I'm trying to use Org-mode for literate programming. Recently, I wrote a convenient function that extracts the content of a code block into a file and calls an asynchronous command to run the code. I'm not sure if there is already a package in the community that implements similar functionality; if there is, please let me know. Below is my version—what do you all think? Please leave a comment, thank you!

;;; -*- lexical-binding: t; -*-

(require 'org)
(require 'ob-core)

(defvar org-src-languages
'(("C" . "runclang")
("C++" . "runclang")
("bash" . "bash")
("clojure" . "clojure")
("elixir" . "elixir")
("fish" . "fish")
("go" . "go run")
("haskell" . "runghc -dynamic")
("html" . "open")
("java" . "java")
("js" . "deno run")
("racket" . "racket")
("rust" . "cargo run --bin")
("scheme" . "guile")
("ts" . "deno run")))

(defun org-babel-tangle-and-run-src-block ()
(interactive)
(let* ((info (org-babel-get-src-block-info t))
(params (nth 2 info))
(lang (nth 0 info))
(command (cdr (assoc lang org-src-languages)))
(tangled-file (cdr (assq :tangle params))))
(unless command
(user-error "Unknown language: %s" lang))
(unless (and tangled-file
(not (equal tangled-file "no")))
(user-error "Source block has no :tangle"))
(if (equal lang "rust")
(let ((cargo-dir "rsb")
(bin (file-name-base tangled-file)))
(unless (file-directory-p (format "./src/%s" cargo-dir))
(call-process "cargo" nil nil nil
"new" (format "./src/%s" cargo-dir)))
(org-babel-tangle)
(async-shell-command
(format "cd ./src/%s && %s %s"
(shell-quote-argument cargo-dir)
command
(shell-quote-argument bin))))
(org-babel-tangle)
(async-shell-command
(format "%s %s"
command
(shell-quote-argument tangled-file))))))

(defun org-babel-tangle-and-run-other-src-block (direction)
(save-excursion
(pcase direction
('next (org-babel-next-src-block))
('prev (org-babel-previous-src-block))
(_ (user-error "Unknown direction: %s" direction)))
(let ((org-babel-current-src-block-location
(org-babel-where-is-src-block-head)))
(org-babel-tangle-and-run-src-block))))

(org-link-set-parameters
"nrun"
:follow
(lambda (_lang _arg)
(org-babel-tangle-and-run-other-src-block 'next)))

(org-link-set-parameters
"prun"
:follow
(lambda (_lang _arg)
(org-babel-tangle-and-run-other-src-block 'prev)))

(provide 'tangle-and-run)
;;; tangle-and-run.el ends here



https://redd.it/1wo1som
@r_emacs
Reddit From the emacs community on Reddit Explore this post and more from the emacs community
Post #28587 11
How to turn keybinds into muscle memory?

I have been using it for a decent amount of time, but I have been mostly using it as a raw text editor simply because its faster and simpler than vscode, visual studio, or anything else

One of the reasons why I used it over vim is because I don't like modal editors, and because emacs is similar enough to a plain text editor to the point of me not becoming completely useless when using it for the first time

But this is also a problem because I don't get to use its "full power" since I can basically do anything once I learn a few simple commands like M-w, C-y, C-/, etc etc
It would be ideal to start learning how to use things like search backwards and forwards, end line, next sentence, instead of going left a hundred times

This is also something to note, the emacs tutorial said that using C-n, C-p, C-f, C-b is superior to using the arrow keys, but I seriously doubt that

Either ways, by the point I am coding, I am too focused on getting things done instead of being efficient with my keybinds, so I don't really learn how to use emacs effectively

Given that, how to get used to actually using the full extent of the emacs to get it into muscle memory?

https://redd.it/1wo0yyc
@r_emacs
Reddit From the emacs community on Reddit Explore this post and more from the emacs community
Post #28585 37
Switching from Obsidian to org-mode - Best Approach for File Tagging?

Hey everyone, I'm hoping to get some advice on using tags effectively within org-mode. I’m a former Obsidian user in the process of switching over to org-mode, but there's so many options and I can’t quite decide on the right direction.

For my use case, in addition to task tracking, I'd like to use org-mode for longer-form writing. This can be meeting notes, video scripts, training content, process SOPs, etc. But generally speaking, I want one file per note, and I'd like to use a flat directory structure with files organized by tags so that I can file them across multiple concepts as needed. This works really nicely in Obsidian with nested tags, but I don't quite get how to replicate this in org-mode. So my major questions are:

1. Should I be using something like org-roam for this? My initial impression was yes, but in exploring that and similar options a lot of them seem to expect tags to associate with headings rather than files, which isn't what I want, unless I've misunderstood.
2. What's the best way to quickly browse, search, sort, etc individual tags? Something where I can browse through tags while seeing associated notes would be ideal.
3. Do nested tags as a concept exist within org-mode at all? For example, in Obsidian I track troubleshooting steps & resolutions within “troubleshooting/linux” or “troubleshooting/emacs”, where troubleshooting is visually collapsible, and I can look at all troubleshooting tags just by clicking that parent tag.

Thanks in advance!

https://redd.it/1wnajg8
@r_emacs
Reddit From the emacs community on Reddit Explore this post and more from the emacs community
Older posts →

About this channel

How can I read @r_emacs without a Telegram account?
TGViewer shows the public web preview Telegram publishes for /r/emacs: recent posts, photos, videos and the subscriber count, with no app, login or account.
How many subscribers does /r/emacs have?
/r/emacs (@r_emacs) has 79 subscribers on Telegram, refreshed roughly every 30 minutes.
Does /r/emacs know I viewed it here?
No. Public channel previews carry no viewer identity, and TGViewer has no accounts or tracking of what you look up.
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →