This channel is a feed for r/emacs. @r_channels @reddit2telegram
Unused packages delete suggestion
I downloaded org-superstar from Melpa last evening and immediately emacs prompted me that 7 packages were not being used. Being a newbie, I thought "great, lets clear those out" and I followed the instructions to delete them. On restarting this morning, I realised that the deleted packages were my Modus-themes, Golden-ratio and pdf-tools (with other pdf related files), all of which are loaded every time I start emacs and essential to my newbie workflow.
Does emacs have a habit of suggesting that you delete files that are actually used and setup in your init.el? ..or more likely, what am I doing wrong that emacs suggested that I delete them?
https://redd.it/1aojdnn
@r_emacs
Release: v0.5 - activities.el: Activities for Emacs (suspend and resume activities, i.e. frames/tabs and their windows, buffers)
https://github.com/alphapapa/activities.el
https://redd.it/1aof1i2
@r_emacs
recommendations for packages for tweaking dired output?
tldr; Looking for packages for customizing dired listings.
Howdy. I've recently gotten an "Emacs splinter" about the format of dired directory listings and after playing with dired-listing-switches I've determined there are not enough knobs there to allow me to filter out some of the stuff I want to filter out. I see that I can write some custom filters also which might take me where I want to go but my elisp skills are still somewhat meager and I have quite a lot on my plate already.
Does anyone have any recommendations for elisp packages already in the ecosystem which might be a quick win here? More so to filter the contents of the listings and not so much, for example, colors (ex:diredfl).
thx!
https://redd.it/1aoao9c
@r_emacs
Setting up org-brain with Doom-Emacs
Hi guys, I recently started my journey with Emacs, Doom emacs to be exact. Promise, I know what I am getting myself into ;)
I would like to dabble in org-brain aside from org-roam. Unfortunately the documentation is pretty thin and there are no instructions what I need to do in order to adapt it to Doom emacs. Org-brain is a flag in the doom config file, but I am pretty sure I need to set it up as well.
Can someone aid me in doing it? I am sure some of have done it or at least know what I need to do for adapting packages.
I heard you shouldn't install as if it was vanilla emacs, but I only starting to understand what that means.
Thanks for your help
https://redd.it/1ao4x60
@r_emacs
Helix movement in emacs?
Hi, I'm taking agda next semester and the recommended editor is emacs, so I want to set it up before semester begins. My main editor is helix and I would like to have helix movement in emacs, is it possible? Before helix I was using vim and I didn't like it, so no evil mode for me. If there is no way to do it, I will just use emacs like notepad.
https://redd.it/1ao2nog
@r_emacs
Colorize logs like VIM or CCZE
I want emacs to colorize log files like CCZE or VIM; how do I do that? I've found the usual "log-modes", none of them colorize making them all but useless for me.
Example of CCZE:
CCZE colorization
​
Example of VIM:
VIM colorization
https://redd.it/1anwb3p
@r_emacs
Emacs 29 - what is right way to install language grammars on Windows?
Hello!
A bit new to Emacs here. Used a little in the past, moved away for a bit and now I'm back.
I wanted to get up to speed and start using Treesitter + Eglot but I'm having a bit of trouble getting the language grammars set up.
I am aware of the command treesit-install-language-grammar
but for some reason, it's unable to run properly, at least on Windows.
Whenever I run it, it eventually fails when trying to clone the grammar repository.
>Warning (treesit): Error encountered when installing language grammar: (file-missing Setting current directory No such file or directory c:/Users/<username>/AppData/Local/Temp/treesit-<random uuid>/repo/src)
Any ideas?
Alternatively for those of you who have had this command succeed, can you give me a rundown of the directory structure you have for any grammars you have installed? I can build grammars manually and use the functional features just fine, but the syntax highlighting is always a bit buggy; some things are highlighted but a lot of things aren't. Also it seems to interfere with any already set themes.
My understanding of things is that it has something to do with the highlights.scm
file inside the queries
folder for each grammar but I'm not sure how to include that(and the other .scm files) file.
I am aware there are pre-built dlls but I kind of wanted to also understand how to manually install things as well.
Thanks!
​
​
​
​
https://redd.it/1anr4vq
@r_emacs
Show/go to the matching parenthesis of the same kind
Is it possible to show/go to the matching parenthesis of the same kind?
Suppose that the buffer has this: ( ] )
. If the cursor is at (
, emacs shows ]
as the (mis)matching parenthesis. Is it possible somehow to make emacs show )
as the matching parenthesis (meaning that emacs should ignore all the other kinds of parenthesis when searching for the pair)?
https://redd.it/1ano0ty
@r_emacs
Is it possible to editing privileged files from windows in WSL 2 Emacs, like c:\Windows\system32\etc\hosts ?
Is it possible to editing privileged files from windows in WSL 2 Emacs, like c:\Windows\system32\etc\hosts ?
I'm still using Emacs-w32 from Cygwin and I start it elevated:
cygstart --action=runas run emacs-w32
so I can edit "privileged" files.
I wonder if WSL's Emacs could be a "system" tool - could I ditch Cygwin completely (having X Server backported by Microsoft to Win 10)...
It could be frustrating to switch text editor just to edit hosts
file...
https://redd.it/1aniylz
@r_emacs
The State of Flycheck: Alive and Kicking
https://metaredux.com/posts/2024/02/10/the-state-of-flycheck-alive-and-kicking.html
https://redd.it/1angve3
@r_emacs
Diff tool accessibility improvement: more meaningful names for conflicting sides and shared ancestor
I'm bad at merging and I'd love to change this.
For context, I can't wrap my head around "theirs" and "ours" in merge conflict resolution tools. Especially since I'm often the solo dev and responsible for both! Since I vaguely remember all the code, I can't even go by "this looks foreign to me" as a heuristic to orient myself. I sometimes lose track when I rebase feature branches with 20 commits onto another branch a couple of files and commits down the road. It's horrible.
I usually can't make sense of M-x diff
output. I often use smerge
and 3-way diffing in git projects, that helps a bit to see things in context, but not always.
For my stupid brain, this is an accessibility problem
Here's the solution I have in mind: to tweak how diff tools show both sides so that the versions have more meaningful names.
Exmaples:
- Merging foo
into main
, it'd be nice if the label reads "changes to be applied from foo" and "base from main".
- Rabasing banana
onto divergent recipes
, with the shared ancestor main
, it'd be great if it reads "changes from banana" and "commonality from main" and "difference from main in recipes".
If you know a diff viewer, conflict resolution tool, whatever that allows this and how one might approach this, pointers would be appreciated! I can Elisp away myself a bit, but don't know where to start.
https://redd.it/1als1u4
@r_emacs
Emacs asking for input method
I dont know why Emacs all of a sudden keeps asking for input methods. This is on a remote, and I cant even find a desktop file to delete (to restart fresh). Restarting Emacs does nothing.
https://preview.redd.it/jfmfmw50bahc1.png?width=399&format=png&auto=webp&s=59a0e06a690fc14006e279e2e171e544b05ba072
https://redd.it/1almm0a
@r_emacs
Adjusting the Window Point of a Buffer not, Currently, in any Window
So the premise is I want to adjust a buffer but, then, make sure that the window point is at a certain location within said buffer (so, when switching to that buffer at any point, the cursor is where I'd expect.
Using with-current-buffer
doesn't work as it manipulates the buffer just fine but won't affect the window point (so switching to the buffer has the point in the same location where it last was, regardless of any changes made to the buffer).
Is there a best practice of how to do this? Is it just making use of switch-to-buffer
and switching back, once done with editing said buffer?
https://redd.it/1alhjr8
@r_emacs
Any reason why some additional characters are being inserted when using yassnippet for java?
​
Im using Doom Emacs and installed lsp-java. this also seems to be happening for other statements like for-loops.
if (condition) {
$TMSELECTEDTEXT0
}f
https://redd.it/1al8iws
@r_emacs
sed commands in emacs (without turning your emacs evil)
https://github.com/oblivia-simplex/emacs-sedition
https://redd.it/1al8kk1
@r_emacs
Can I use consult to find files with a certain name in a massive codebase, and then use consult-ripgrep on those files only?
I hope the title is explanatory.
I am trying to build an Android Lineage version for a device that is outdated now.
I'm getting errors on the brunch
command about some duplicated entries in a file. I know that these entries come from a file called "filecontexts", and I would like that specific entry in order to remove it from a proper file. But since Android codebase is massive I would like to:
- Get all the files called "filecontexts" found. For that I could use consult-find
, right?
- Then get all these files as an input for consult-ripgrep
somehow.
I have absolutely no idea if this could be a possibility but hey, this is r/emacs!
https://redd.it/1aoga7r
@r_emacs
Querying backlinks with org-ql
TL;DR - How do I incorporate backlink searches into my org-ql queries?
​
I am re-structuring my notes to adapt to new demands. I really like the non-hierarchical approach where individual notes are org-mode headers (or files) with an ID property that I can simply link to.
Org-ql is fantastic at querying org-mode headers, keeping dynamic blocks based on those queries, etc. Using org-ql, I can also query for links within a heading. What I am missing is the option to query for backlinks TO the heading. Has anyone solved this problem?
​
Simple example:
Drug A :drug:
:PROPERTIES:
:ID: 12345
:END:
This is an inhibitor of [[id:54321][Protein X]].
Protein X :protein:
:PROPERTIES:
:ID: 54321
:END:
This is a trans-membrane protein that is over-expressed in breast cancer.
If I'm interested in the a subset of inhibitor drugs that are linked to Protein X I can do:
[org-ql-search:(and (rifle "inhibitor") (link "Protein X"))]
But what about finding trans-membrane proteins are associated with (i.e. "backlinked to") inhibitors?
​
OR - maybe there is a way to use org-ql results as org-ql query inputs? For example:
1. Query 1: pull out all drugs.
2. Query 2: pull out all proteins.
3. Query 3: identify all proteins (from Query 2) that have a backlink to drugs (from Query 1).
​
I'm a bit stuck. Any help or pointers would be appreciated.
https://redd.it/1aoeyk5
@r_emacs
which-key description for lambda-binding using use-package :bind
I have something like this in my config:
(use-package emacs
:bind
(("C-c C-k" . (lambda () (interactive) (kill-line 0))))
That doesn't show a useful hint in the which-key-pop-up.
The use-package doc says that is uses the function (bind-key)
so something like this should work, but actually doesn't:
(use-package emacs
:bind
(("C-c C-k" . ("backward-kill-line" . (lambda () (interactive) (kill-line 0)))))
Am I just missing some syntactical finesse or is what I want not possible with use-package's :bind?
https://redd.it/1ao8ltk
@r_emacs
el-project.el -- Generate project skelton for Emacs Lisp
https://github.com/Kyure-A/el-project
https://redd.it/1ao25jz
@r_emacs
Any way to make the M-x dialog more mouse friendly (allow clicks and scrolling with the scroll wheel)?
https://redd.it/1anx80l
@r_emacs
Xref stack visualizer?
When exploring an unfamiliar codebase I'll often be good 10-15 xrefs deep in a stack. This can get pretty confusing quickly to know where I started. Is there any package that makes a tree or other sort of visualization for this?
...actually, for that matter, is there any package that forms the xrefs into a tree from a plain old stack? I'll often jump back up, go to another xref, then want to go back to the original branch without losing my place.
https://redd.it/1antmo4
@r_emacs
multi-buffer.el, my first package!
So the other day I spent more than 3 seconds renaming eat buffers, so I decided to spend more than 3 days to make my own package that does it automatically. After finishing, I found that if you launch eat with a prefix argument it does exactly what I wanted.
Nevertheless, this package has more features (like updating the indexes when a buffer is closed & more formatting options) and not only it works for eat, but for everything that when launched checks if the buffer already exists and uses that instead of creating a new one (I only tested vterm and eat) so it can be used as a simple replacement to multi-vterm and multi-term.
I really recommend the experience. I've been using emacs for about a year, and even though you do learn by making your config, making a package gives you a waaay higher level of understanding, even if it's a basic one like mine.
I tried to make the best code I could, but I'm no elisp/lisp programmer, but a C one, so probably the style isn't exactly right. There are a few features I didn't add yet and it could be way better documented.
Here's the link for anyone interested: https://gitlab.com/vslavkin/multi-buffer.el
Edit: not sure if the name is good or not, please tell me if you have a better alternative
https://redd.it/1anp6a4
@r_emacs
Error loading autoloads: (error Invalid face shadow)
When I look at the messages buffer after I load Emacs, the first message that appears is
Error loading autoloads: (error Invalid face shadow)
I've tried to find the source of the error (e.g., by changing the theme) but have had no luck. Does anyone have any idea what this could be or how I could go about finding it?
https://redd.it/1anhvfj
@r_emacs
Test your ELisp knowledge
https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00363.html
https://redd.it/1anhdmi
@r_emacs
Has anyone gotten dap-mode cpptools working on NixOS?
It doesn't run for me without
BINARY="/home/st/.config/emacs/.local/etc/dap-extension/vscode/cpptools/extension/debugAdapters/bin/OpenDebugAD7"
INTERPRETER="$(nix-build '<nixpkgs>' --no-out-link -A pkgs.glibc)/lib/ld-linux-x86-64.so.2"
patchelf --set-interpreter "${INTERPRETER}" "${BINARY}"
Looking ahead to Emacs 30 [LWN.net]
https://lwn.net/Articles/959931/
https://redd.it/1alqwu4
@r_emacs
emacs freezing for several seconds while lsp-clangd running
Emacs keeps locking up while I'm trying to code. I'm sick of it. 3 or 4 random seconds where nothing emacs related works. Sometimes it'll go for hours without incident and sometimes its every ten minutes.
These are my garbage collection settings. Are they to high? Could an org-roam db sync be causing this? How do I even trace the freeze up, I can't interact with emacs at all. HTOP shows that 1 cpu core pegs at 100% while this is happening, but nothing else about my system slows down.
;;Garbage collection:
(setq gc-cons-threshold (* 2 1000 1000)
gc-cons-percentage 0.6
read-process-output-max (* 1024 1024))
(require 'gcmh)
(gcmh-mode 1)
Here is a backtrack from it locking up and running killall -USR2 emacs from a terminal.
Debugger entered--entering a function:
* clear-minibuffer-message()
​
https://redd.it/1alif3r
@r_emacs
Is it possible to export a single org-mode document into multiple files with one command (or a simple series of commands)?
For context, I'm creating a master document for a course I'm helping to design as the "source of truth" for all subsequent documents (e.g. anki cards, homework assignments, etc.) I would like to be able to compile certain sections to separate files (e.g. the homework separate from the keys, separate from the anki-decks, etc) without putting everything in different files.
Does anyone know of a way to do this or something similar? I think I could so something similar-ish by using org-transclusion, but it seems to go in the opposite direction (namely, that the separate documents are included into the big org file, but I would still need to edit them and export them from separate files).
Any help would be greatly appreciated, and thank you for reading and for any tips in advance!
https://redd.it/1alcbt6
@r_emacs
As someone with ADHD, I find Emacs extremely handy
So I just started out with Emacs because I wanted to use SLIME for Lisp, but I quickly realized how helpful it can be even without knowing most commands and keybindings.
The fact that I can have something like a web browser integrated in Emacs is extremely helpful for my ADHD because I can just fire up Emacs in the tty, edit my code in one window and have online docs in the other window, and jump between them and copy stuff from the browser to my code, all in a single workflow, and without anything like YouTube distracting me or getting lost in tabs or desktop.
While with other editors/environments I have to context-switch between at least 3 different workflows (editor, WM/tmux, browser, and usually other stuff like terminals), carefully configure them to not clash, and implement all sorts of nasty hacks to move data between them. And of course getting my thought process cut short is inevitable.
Emacs makes it so much easier to stay focused on my project.
https://redd.it/1alaacv
@r_emacs
Rmail+IMAP - changing directories?
Context, I use Gnus for IMAP email (Fastmail). I like it enough, but figured I could give Rmail a try - you know, the endless itch to try things. In my case I am leaning on built-ins and if possibly smaller packages. Which Gnus is not. And Rmail is the "primary email reader".
I got the impression this setup could be less straightforward than the "it just works" approach of Gnus, but still. I installed `movemail`, made a backup copy with `offlineimap` in case I deleted all my messages by accident :) and then
(setq rmail-primary-inbox-list '("imaps://my-user%40fastmail.com:the-password@imap.fastmail.com:993"))
It worked! Nice!. Except that I have a bunch of aliases (bills@mydomain.com, subscriptions@mydomain.com, etc.) and rules to redirect the messages to sub-directories of Inbox and I don't see a way to get those with `movemail`.
I am guessing the config would be one mail file for each one of those directories? But still can't find how to set that up.
I might try pointing Rmail to the Maildir back up too, but just like IMAP, it is a one way conversion so I figured I would ask in case I destroy that synced copy for nothing :)
Thank you!
PS: Using Maildir as describe here: https://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Mailbox-Formats.html
https://redd.it/1al76of
@r_emacs