r_emacs | Unsorted

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

-

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

Subscribe to a channel

/r/emacs

Package achieves

Please to any emacs user. I just installed emacs on Linux am a complete beginner so I followed some tutorials online to MELPA packages did all the configurations in my init.el file but melpa still won’t add in my package archive!
Please what am I missing???

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

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

/r/emacs

Severe slowdown after invoking org-refile

I recently upgraded from emacs 28.2 to 29.3. I noticed that if I opened an 11MB org-mode file (that used to give me no problems with speed or performance on 28.2) and then invoked org-refile once, then suddenly any user interaction involving the big 11MB buffer (from text entry to simply activating the buffer) would take forever to execute.

I wondered if it was something in my config, and eventually noticed that switching org-refile-use-cache from t to the default nil stopped the slowdown from happening after invoking org-refile. I confirmed the issue was seemingly solved by running a minimal org-mode config in an emacs -Q session and observing that the slowdown only happened if org-refile-use-cache was set to t.

So I decided to just stop setting org-refile-use-cache to t and everything seemed fine, but soon enough I started noticing the same slowdown associated with the big buffer over the course of a work session, though I had no idea the cause.

I have since tried messing with the garbage collector as suggested at https://www.reddit.com/r/emacs/comments/msll0j/do\_any\_of\_you\_have\_some\_tips\_on\_speeding\_up\_emacs/ but that did not help. I know the issue is not setting org-refile-use-cache to t, but that's the only way I know how to reproduce the issue. To give you an idea of how immediate the slowdown is, I use abbrev expansions a lot. One common one expanding "n" to "and". Before invoking org-refile, I can press "n{space}" several times in a row very quickly in the big buffer and the expansions happen instantly. But the moment after I first invoke org-refile, then typing the same series of "n{space}"s in fast succession in the big buffer takes several seconds for all the "and"s to appear on screen.

This issue has been reproduced on both my Windows 10 and 11 machines, with emacs versions 29.3 and 30.0.50. Any help would be appreciated! I don't want to go back to 28.2 when there's so many new features in 29 and 30.

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

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

/r/emacs

Which font is missing here?

\\"Dired\\" in Debian 12 Eamcs 28

Which font is missing here? How can I figure it out?

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

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

/r/emacs

Tree-sitter syntax highlight for LaTeX

How is the support for tree-sitter syntax highlight on LaTeX files currently? I've been using Emacs 29 with tree-sitter explicitly enabled when building it (probably redundant for 29, but just to be sure), and still couldn't find a way to enable it for TeX mode. Could someone using it now help me by pointing out where to start to make it work?

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

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

/r/emacs

GitHub - erickgnavar/pythontest.el: Run test on demand with support for different test runners
https://github.com/erickgnavar/pythontest.el

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

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

/r/emacs

help Emacs on Wayland strange glitches on line number area

https://preview.redd.it/14w2k3r37x2d1.png?width=1923&format=png&auto=webp&s=4bbb588d5c6d90ec21fc5848f17d48a4a98d3aff

You can see the glitching on left side of screen. I use NixOS with Hyprland and Emacs 29 (PGTK) with some transparency. I turn on my line numbers with `(nix-ts-mode . display-line-numbers-mode)` for example. I notice after resizing the frame all goes back to normal. Any ideas ?

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

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

/r/emacs

toggle-term.el - Now in the MELPA
https://redd.it/1d1ig98
@r_emacs

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

/r/emacs

Doom Emacs with unity and unreal engine?

Hi, I'm new to using Doom Emacs, but I've already fallen in love with it. Before using Doom Emacs, I used Visual Studio (for Unity and Unreal Engine) and VSCode for other projects. My question is, is it viable to use Doom Emacs with Unity and Unreal Engine, or should I stick with Visual Studio and change VSCode for emacs(basically use Doom emacs for other projects that dont require a game engine like unreal or unity and use Visual Studio for those two)?

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

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

/r/emacs

Is it possible to have a function open the minibuffer with a command but not run the command?

What I mean is I have a hydra menu for shortcuts to all my common files like so:

("ce" (find-file "~/.emacs.d/config.org") "emacs")


which runs find file on the exact path given after I open the menu and press the keys "ce".

Now I also want to add shortcuts to all my common directories but doing something like:

("hd" (find-file "~/Downloads/") "downloads")


runs the find-file on the exact directory path which just opens a dired directory into Downloads.

What I really want though is after typing "hd" it opens the minibuffer with find-file command (as happens when you type C-X C-f) with the ~/Downloads path already open so I can just pick a file from Downloads from the minibuffer itself.

Is there a function to make something like this possible?

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

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

/r/emacs

question about ts modes implementation in emacs

I wanted to look at how we highlight a major ts mode (to understand it and see if I can easily do it for markdown with injections)

I just took a look at python-ts-mode and saw that
it does
```(setq-local treesit-font-lock-settings python--treesit-settings)```

and after that to my surprise I checked python--treesit-settings and it kind of reimplements the same capture groups as the highlight file already created by the tree-sitter-python github https://github.com/tree-sitter/tree-sitter-python/blob/master/queries/highlights.scm

for example
```
:feature 'number

:language 'python

'([(integer) (float)\] @font-lock-number-face)

```

already exists in the highlights file
```
[

(integer)

(float)

\] @number`
```
why can't we just use the highlight group `@number` somehow and set it to `@font-lock-number-face`

seems a lot of double work if we do it for every language

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

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

/r/emacs

Is there way to open LARGE files faster?

Hi everyone, I am have projects with 10k+ lines of code and emacs is really slowly open them, or if I trying to copy and paste large amounts of text (> 5k) its humiliatingly slowly paste them but at the same time, for example in nvim they are open quickly, my computer is ok so I dont think thats the problem in hardware. (sry for my bad language)

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

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

/r/emacs

Orgmode now fails to apply agenda filters to preset templates

After years without issue where I could choose, for example, to see my daily work agenda, the filters are now failing to be applied. This is in org 9.6.15, as shipped with my emacs 29.3. Here is my definition from my use-package org :custom section:


(org-agenda-custom-commands
'(("w" . "Work")
("wd" "Work Day"
((agenda ""
((org-agenda-span 1)
(org-agenda-start-on-weekday nil)
(org-agenda-regexp-filter-preset
'("+ODH\\|AGENDA\\|CONFERENCE" "-TSA\\|PRIESTHOOD")))))
nil)))

Why has this stopped applying my filter when it worked for so long? Is it a bug, or do I need to change something to make it up-to-date?

(I'm cross-posting this to both reddit and the orgmode mailing list since the two audiences might not overlap much)

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

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

/r/emacs

rust-mode, eglot does not start, missing slot name error

I am trying to follow a setup video for Emacs as a Rust "IDE". The video is: <https://www.youtube.com/watch?v=qzqd6EsVBxI&gt;. In the video they have it very easy to set things up:

1. start Emacs
2. run treesit-install-language-grammar and choose rust and all default settings
3. run rust-ts-mode, now working because a tree sitter grammer is now available
4. install rust-analyzer using rustup
5. M-x eglot RET

I have done all these steps, but eglot fails to start. I get the error:

slot-missing: Invalid slot name: "#<eglot-lsp-server eglot-lsp-server-a78e38>", :events-buffer-config

I even ran Emacs with emacs -Q and performed the steps in order, except for installing rust-analyzer, because it is already installed. Still seeing the same message when I M-x eglot. To me this message seems to indicate, that events-buffer-config is some member of some object or a kind of message or signal, that should be available, but apparently is not. And I have no idea how to fix it.

My Emacs is:

This is GNU Emacs, one component of the GNU/Linux operating system.

GNU Emacs 29.3 (build 1, x8664-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0)
Copyright (C) 2024 Free Software Foundation, Inc.

I installed Emacs via GNU Guix, but I don't think that should be the issue. I can post my Guix channels file and manifest file here, if someone thinks that could be an issue.

This is a Debian 12 inside a VM, that I am trying to set up explicitly for Rust coding:

debian@debian:[0]:/home/debian$ lsb
release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

I furthermore found out, that I cannot open/see any eglot messages buffer:

M-x eglot-events-buffer RET:

eglot--error: eglot Can't find an Eglot events buffer!

I guess this is normal, since eglot could not even start.

Anyone got any idea what I am doing wrong? Yes, I could try lsp-mode instead and all that, but it looked so simple in the video and I really only want some completions in a popup for me to select from when I type :: or . while coding Rust and some ability to refactor-rename variables and things. Nothing super fancy, I recon. And eglot seems to be integrated into Emacs, the default, basically, so it should work? Anyway, if I really can absolutely not get it working, I will explore other options, but I would like to try to solve this issue first.

EDIT 1: I only found this similar looking issue, but it is for fsharp: <https://github.com/fsharp/emacs-fsharp-mode/issues/338&gt;

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

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

/r/emacs

Touchscreen events on Emacs 29
https://youtu.be/9pjJlPr__Yw

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

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

/r/emacs

org-mode links that open a directory in Windows Terminal
https://youtu.be/jKdkQpHl7vY?si=9ylMeGNkDWMqtKLN

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

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

/r/emacs

Which pipeline to sync contacts between Emacs and an Android contact management app?

I currently use Google Contacts to manage my contacts on Android and PC (web app). But I'm now trying to get rid of Google (I just started using notmuch, goimapnotify, mbsync, msmtp, etc. instead of Gmail web app).

I read that synching Google Contacts with a Desktop was a nightmare, so I thought about using an open-source Android contact management app instead (like Fossify Contact, OpenContacts or ConnectYou).

The idea would be to start from a Google Contact export and then continuously populate either the Mobile app or the Desktop a desktop app.

On the Desktop side, I'd prefer to use Emacs (e.g. ebdb or org-contact). Ideally, Syncthing would do the sync between Mobile and Desktop.

I couldn't find tutorials on how to implement this. Would you have any advice (my desktop OS is Linux Arch)?

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

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

/r/emacs

Enchanted Spell Checker: Jinx
https://youtu.be/JnoV-hclk58?si=ND96EaVUcXAgOOcv

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

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

/r/emacs

I either found a very funny Easter Egg or a bug

So, I was trying to use the `goto-char` command for something. While doing that I wondered what would happen if I used it with a negative argument in minibuffer. When it asked me the character, I entered -1. This had very ... interesting results.

Resulting buffer

Original buffer

It looks like every character is swapped with something. It is reflective too which is very interesting in my opinion.


It also looks like the frame is cursed, not the buffer :D. I can confirm that by opening the buffer in any other frame or opening any other buffer in this frame.


What I wonder is if this is like an Easter Egg, or a bug?

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

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

/r/emacs

Against hardcoding program names

To any elisp developers out there, please don't hardcode the name and options for external programs. A better alternative is to use variables named
<command>-program
and
<command>-program-options
, or
<command>-command
and
<command>-command-options
.

Relying on $PATH for program resolution is great until it doesn't work.

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

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

/r/emacs

Space-bar sometimes beeps randomly

I just installed a brand new Debian GNU/Linux 12 box, then installed GNU Emacs 28.2 using `apt-get install emacs`. It works fine. But when editing a regular text-file, I find about one time in eight that I press the space bar, as well as inserting the space, it emits a beep, as though I had typed C-g. This seems to be random: sometimes I will type 20 or more spaces with no beeps, other times two or three consecutive spaces might beep. The space-bar is bound to regular self-insert-command as you would expect.

Does anyone know how to prevent this harmless but very irritating quirk?

(And why is it happening straight out of the box?)

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

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

/r/emacs

support for copilot?

Hi there i am a student and have a github student dev pack. It comes with copilot and I use it when something don't make sense in my code and to write commit messages and do a quick chat in vscode. I cant affort any other paid service and i hate using vscode. Neovim has a great extension for copilot chat with plethora of features but on emacs side the support is very minimal with just the copilot.el. I can understand why such thing land late in emacs community due to FOSS principles and i totally respect that. Should i lose hope on good copilot support in emacs and just accept the reality? Folks who use copilot is there any good copilot package that i am not aware of?

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

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

/r/emacs

How to display changing svg in real time?

I am trying to implement a typst inline live preview. I know there is a package that does the full typst preview using a web browser, but I want to have the svg images displayed inline inside an org buffer. I see that using the svg library we can create new svg images and have them displayed in real time, but can this be done with the output of typst?

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

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

/r/emacs

Correct usage of gc-cons-threshold and gc-cons-percentage

Hi,


After reading a couple of posts on here covering aspects of gc-cons-threshold, I checked the documentation too.

As a not-very advanced Emacs user, I will admit that the topic is not very clear. Trying to summarize what I think I read:

1. by setting the gc-cons-threshold to a high value, garbage collection can be temporarily delayed

2. a large value shouldn't be used as the default.


If the above is correct, would that suggest that:

1. I could set the gc-cons-threshold to a higher value at the beginning of the init.el

2. Use the after-init-hook to reset the value to a lower/default value.


Does the above make sense or have I misunderstood the other threads/documentation?


As regards the gc-cons-percentage, the doc says "If this portion is smaller than ‘gc-cons-threshold’, this is ignored". How can I check this?


thank you

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

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

/r/emacs

Complex layouts in enlight via grid.el
https://redd.it/1d130si
@r_emacs

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

/r/emacs

Bug with org-present, annoying line in the middle of previewed image?

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

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

/r/emacs

Static completion table with marginalia

I can create a simple completing read prompt to choose from a list. Is it possible to get marginalia descriptions that come from an alist or some other static data structure?

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

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

/r/emacs

Doom Emacs LSP deferred mode and lsp-rename issue

I set my projectile path and projects were indexed correctly. But I still have to start my lsp manually and tell it its project root. Can I somehow configure lsp-mode that it uses projectile's project root and set it to start automatically?

I read online that Doom starts lsp-mode in deferred mode but this doesn't appear to be the case as I have to start it manually. I'm using default config with (go +lsp) under :lang.

And another problem. If I start lsp in one buffer and use lsp-rename it only renames in the current buffer and not in the project.

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

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

/r/emacs

Optimizing Emacs capabilities as a PhD student

Hello all,

I've been using Emacs for 2+ years now. I started using because of its capabilities in VHDL coding, but soon got inspired by its efficiency. However, I feel I am severely underutilizing its potential. I'm a PhD student in Computer Engineering, and mainly use it for coding in python (with jedi). With this context, I want to ask the following questions:

1. Best package for Python? I find jedi decent, but not coding-friendly. I want to code faster in Python.
2. For a Mac user, what are the key-bindings you suggest is optimal?
3. Best use cases of org-mode as a PhD student?
4. Best LaTeX packages & engines I need to install on Emacs? Currently I use Overleaf to work with collaborators, but would love to work on Emacs and push things to Overleaf (my vim friend does this).
5. Ways to use Co-Pilot on Emacs? Is it worth it?
6. Any other cool Emacs things (packages or modes) I should learn as a PhD student?
7. Any cool stuff that can wow me about Emacs?

Please feel free to help even if you are not a PhD student. My goal is to learn how to use Emacs better at the end of the day..

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

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

/r/emacs

Is there any way of saving sets of windows and switching between them?

First of all, I d like to thank all the contributors to this subreddit, I have learned a lot from it over the years.

The question I have is as follows. Let's say I have two windows open side by side in a frame, and I have two different directories open in dired in each of the windows. Is it possible to save this set of windows/layout and quickly switch to it in the future? Or when I'm programming, I typically have a main window with my code on the left with two smaller windows (compilation and vterm) next to it. I would like to be able to quickly switch between sets of predefined windows within a frame. Wouldn't that be amazing? Is such a thing possible?

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

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

/r/emacs

emacs-29 slow on Windows

On my Windows 10 machine, I finally made the jump from emacs 28.2 to 29.3 today (by installing from the standard emacs-29.3-installer.exe from the GNU mirror. I noticed an immediate slowdown of the whole program when I opened a large (10MB) org file that had never caused me trouble in version 28.2.

I’ve read similar stories about emacs 29 being slow, but I figured it would have been fixed by now. Is the only solution to compile my own, as described here?

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

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