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

Enable all features in FlyCheck with Rust?

Hey all, I was poking around for an answer to this in the LSP and FlyCheck docs, but couldn't see it anywhere. When I debug Rust code I don't get syntax highlighting under certain inactive code (specifically when statements like #[cfg(target_arch = "x86_64")\] appear). I tried adding a line to my .cargo/config to enable these features features but rust-analyzer doesn't seem to pick it up. I feel like there's a basic option for this, so apologies if I've missed something but I'm rather new to emacs.


​

https://redd.it/18vghbu
@r_emacs

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

/r/emacs

From Fill Prefix to TRAMP - Highlights from Mastering Emacs Book Club
https://susam.net/maze/from-fill-prefix-to-tramp.html

https://redd.it/18v5wx3
@r_emacs

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

/r/emacs

jart/emacs-copilot: Large language model code completion for Emacs
https://github.com/jart/emacs-copilot

https://redd.it/18varm1
@r_emacs

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

/r/emacs

Interpret Alt as Alt in Emacs on Windows.

I would like the Alt key on Windows to be interpreted as alt by Emacs (I use the windows key as meta). I have tried to (setq w32-alt-is-meta nil), but this does not seem to work. For example, setting (global-set-key (kbd "A-x") #'execute-extended-command) does not let me use Alt+x to execute a command. Instead, A-x is mapped to insert-char, and it actually inserts a multiplication sign! I get similar output for Alt+ other characters on windows. Is there a way to get Emacs on Windows to read "A-x" as "A-x"?

https://redd.it/18re96g
@r_emacs

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

/r/emacs

37C3: Unlocked (2023)

Hey. Will there be any emacs related content @ 37c3?

https://redd.it/18ruxtw
@r_emacs

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

/r/emacs

Update vc-mode modeline indicator in hook

How do I update vc-mode's modeline indicator in a hook, like after-save-hook?

https://redd.it/18rrlld
@r_emacs

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

/r/emacs

Emacs: Not a text editor, still awesome!
https://www.youtube.com/watch?v=_H9TXKokNQ8

https://redd.it/18rtdfy
@r_emacs

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

/r/emacs

Autocomplete in customization buffer

Hey there, I would like to get some autocompletion working in customization buffer.

Lets say I have this emacs lisp snippet:

(defcustom my-file-custom-variable "/home/user/my-file.txt"
"Path to my file."
:type 'file)

Emacs manual(https://www.gnu.org/software/emacs/manual/html\_node/elisp/Simple-Types.html) mentions this about the file widget type:

>The value must be a file name. The widget provides completion.

But I cannot get my emacs to perform autocompletion on file path. Is there something wrong with my elisp snippet? is there any key binding to trigger autocompletion? Is there some additional setup required for autocompletion in customize buffer? Or do I simply misunderstand the emacs manual?

https://redd.it/18rxmyi
@r_emacs

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

/r/emacs

Emacs loads slowly even if i move my .emacs file away

I'm trying to rebuild my configuration file from scratch since emacs has been taking 3 seconds to load.

When starting emacs -Q, it starts in the 0.3 seconds I would expect.

But when moving my .emacs away to like dot-emacs-bak and starting emacs, it still takes 1.1 seconds to load. The *Messages* buffer is empty in that case.

C-h v user-init-file shows .emacs in all cases

Starting emacs seems to load some things that are not in my ~.emacs file.

How can I find out what that is and disable it?

https://redd.it/18rv5oo
@r_emacs

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

/r/emacs

Why does cl-find-method require a symbol when CL's find-method requires a function?

I defined

```

(defclass test-class ()

((greet :accessor greet

:initform "Hi")))

```

and

```

(defmethod test-method ((instance test-class))

(print (greet instance)))

```

Then `(find-method (symbol-function 'test-method) nil '(test-class) nil)` works to test if `test-method` is defined just fine, however `(cl-find-method (symbol-function 'test-method) nil '(test-class))` returns an error, and I need to instead run `(cl-find-method 'test-method nil '(test-class))` to obtain the method I am looking for. Why do we have this difference in behavior?

https://redd.it/18rs049
@r_emacs

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

/r/emacs

Icons in Dired mode on Windows 10 work fine, but emojis do not

Edit: I somehow didn't managed to insert the picture in the post, so here it is as a link to imgur.

As you can see in the picture, I've succeeded to get Icon rendering in Dired on Windows 10, however emojis do not work at all.

Seems weird that I'm able to render icons and not emojis. I understand they are different, but I'm not getting why the one is able to be displayed and the other is not.

I've read every article I could find on this sub and google about Emojis in Emacs on Windows, but most articles are either 2+ year old, or have some broken links and succeeded to fix this issue.

I'm running native Emacs on Windows, I'm not using WSL.
I'm using Emacs 28.2.

I have installed all-the-icons.
I also have installed "Noto Color Emoji" and put this in my ~/.emacs:

 t 'symbol "Noto Color Emoji")


And evaluated. I've also tried with "native" windows emoji font: Segoe UI Emoji, but same story.

I'm getting the emoji in the buffer, but it's invisible. If I copy it from, say, emojipedia and CTRL + y in a buffer, the cursor moves as if something was inserted, but nothing is shown as if I inserted a SPC.

However if I CTRL+a CTRL+k and then paste it in, say, my browser, I get all the emojis I've inserted in the buffer.

My question is - Has the Windows API changed(that is the reason, allegedly, why it didn't work in the past as I've read about this issue on this sub) or is there some other way to display emojis in Emacs buffer on Windows 10 that bypasses this API problem or whichever other problem there is.

On my Linux machine everything works fine, however, unfortunately, sometimes I'm forced to use Windows and thus want to make it work here as well.

https://redd.it/18qu0ss
@r_emacs

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

/r/emacs

Gnus and Outlook Exchange without Davmail?

Hello Emacs Community!,

​

I have several mail configured in gnus and smtp-multi, as I couldn't get the smtp separated sending with only the posting styles. It is pretty simple really and it works with application passwords,

​

However, I recently have to be checking now an Exchange work mail, and the reason I was using GNUS in the first place is not to have external dependencies like with mbsync... Is there any configuration that I can do to still get this mail?, or am I doomed to go to another app or use davmail?,

​

Thank you!

https://redd.it/18qk1b2
@r_emacs

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

/r/emacs

1](https://www.reddit.com/r/emacs/comments/188kpwp/emacs_advent_calendar_1_stable_releases_of/).

https://redd.it/18ptb7o
@r_emacs

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

/r/emacs

Emacs 29.1 AppImage (self-contained single executable for linux) with native-compile
https://github.com/blahgeek/emacs-appimage

https://redd.it/18pyg9p
@r_emacs

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

/r/emacs

Developing a customized terminal experience in emacs?

My work involves a fair amount of time spent in the terminal, in docker containers, on remote machines via ssh, and sometimes in containers on remote machines. To support this, I’ve developed a customized terminal experience on kitty. Basically, if I open a new tab, it will clone my current environment, including the container/remote, current directory, and current bashrc. And it also color-codes tabs based on the type of environment I’m in.

I’m curious if it would be possible/interesting/desirable to recreate this setup in emacs, with the ultimate goal of using emacs as a customized ide + terminal emulator.

Does anyone have thoughts on this? The first issue that I see is that so far, I haven’t found a tab bar for emacs that supports customizing the colors of the tabs. I’m sure this is possible, but I’m too new to emacs to know how difficult it would be (I have experience coding in multiple lisp dialects, so needing to code in order to customize is not a drawback). Thanks.

(EDIT: I guess this is partly a question about customizing emacs and partly a question about using emacs as my primary terminal emulator.)

https://redd.it/18pvwwm
@r_emacs

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

/r/emacs

Need help understanding tree-sitter major modes...

So I followed the mastering emacs guide to installing tree-sitter but am left a bit confused about what actually these additional major modes are and have some questions.

1. What is the difference between the installing the package tree-sitter and building emacs with tree-sitter? Which one should I use given both options?
1. Do these new ts major modes serve to replace existing modes or do they sit on-top of the regular modes? So If I was using rustic package for rust development, does rust-ts-mode essentially replace the rustic package or would I still need it?
1. How would you tell emacs to use tree-sitter mode if there are no default major modes for the language to begin with? For example rust or go don't have built-in modes like python or bash do so a command like (setq major-mode-remap-alist '((go-mode . go-ts-mode))) would not work unless you explicitly install the go-mode package.

https://redd.it/18vfs3y
@r_emacs

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

/r/emacs

Building a custom Emacs auth-source
https://www.emoses.org/posts/emacs-custom-auth-source/

https://redd.it/18vcsb7
@r_emacs

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

/r/emacs

From Zero To IDE with Emacs and LSP
https://justinbarclay.ca/posts/from-zero-to-ide-with-emacs-and-lsp/

https://redd.it/18vmnb9
@r_emacs

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

/r/emacs

Good examples of tab bar customisations?

I use tabspaces + project.el so each tab in the tab bar represents its own project. Like this:

https://preview.redd.it/pxku3u4x3p8c1.png?width=1304&format=png&auto=webp&s=1bc23614698024dd7232b689707c1eb48fc067ec

I've only made some trivial customisations but not sure where to go to make it a little bit more helpful. This is basically it.

(setq tab-bar-close-button-show nil)
(setq tab-bar-tab-hints t)

Every example I've seen so far seems to be specific to a config framework like Doom or Nano. No complaints there but would be keen to see some other unique examples in the wild.

What have you got, if you use tabs? Since we're in emacs I figured they could do a lot more than this, as with the modeline and minibuffer.

https://redd.it/18rgy3k
@r_emacs

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

/r/emacs

Every LLM in Emacs, with gptel
https://www.youtube.com/watch?v=bsRnh_brggM

https://redd.it/18s45of
@r_emacs

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

/r/emacs

Exporting PDFs with LaTeX issue

I'm about a month into my emacs adventures with a primary focus with using it for org documents. I am on MacOS and use doom emacs currently as my distro.

When exporting with LaTeX pdf I get: "zsh:1: command not found: pdflatex" in my Org PDF LaTeX Output buffer. LaTeX is installed on my machine and the export works fine from terminal emacs (emacs -nw) so from what I've read this is likely a PATH issue. However, the whole setting a PATH so that emacs can see where LaTeX is is over my head with my current knowledge as I have little experience in terminal.

Is anyone able to explain how to go about letting emacs see where LaTeX is installed? Or maybe insight into a solution if this isn't the issue?

I know where pdflatex is by running "which pdflatex" in terminal but do not know next steps.

Thanks!

https://redd.it/18s1n1j
@r_emacs

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

/r/emacs

AI coding auto-complete + assistants

What is your set-up for AI auto-complete in software development? I'd like to set up something similar to VSCode where you get AI auto-completion at point.

I already use packages that provide a chat based interface, looking for a faster interface to OpenAI from within my code files.

https://redd.it/18rkds0
@r_emacs

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

/r/emacs

I've written a package for parsing command line help, and would appreciate feedback!
https://github.com/andykuszyk/noman.el

https://redd.it/18rxn71
@r_emacs

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

/r/emacs

Weekly Tips, Tricks, &c. Thread

This is a thread for smaller, miscellaneous items that might not warrant a full post on their own.

See this search for previous "Weekly Tips, Tricks, &c." Threads.

Don't feel constrained in regards to what you post, just keep your post vaguely, generally on the topic of emacs.

https://redd.it/18rvq33
@r_emacs

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

/r/emacs

nano vertico minor mode
https://redd.it/18r6pyv
@r_emacs

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

/r/emacs

Is there a way to include a file in an org file like a library?

I want to use code that I wrote in one file in a separate org file. I'd like to use this in combination with the ability to chain org blocks together. What I am imagining is there being a thing like #+include: to import any code I want to use from there to my org file, without actually exporting the contents of the first file. So, for example, if I have a file `one.org` with the contents...

#+name: test
#+beginsrc python
x = "Hello World"
#+end
src

I would like to be able to use this in another file `two.org` in a way like...

#+include-but-dont-export: pathto/one.org

#+beginsrc python :include test
print(x)
#+end
src

#+results:
: Hello World

Is there anything like this, currently? Thanks.

https://redd.it/18qrg33
@r_emacs

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

/r/emacs

PSA (as part of `advent` series): /r/planetemacs is a low traffic--almost to the point of non-existent-- Emacs subreddit will finish almost 5 years in few days. If you need to no drama, bird's eye view of happenings in the Emacs world then this subreddit is just for you
https://reddit.com/r/planetemacs

https://redd.it/18qjh7c
@r_emacs

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

/r/emacs

Emacs Advent Calendar, day 24: blamer, file-info, orgnote, etc

> Let's create an Emacs Advent calendar! It would be nice if for every day till Christmas someone takes the opportunity to showcase their Emacs work. It will be interesting to see what you are all working on.

Great idea! Here are some of my Emacs packages that I've been working on

### Blamer.el
https://github.com/Artawower/blamer.el

Blamer.el is a minor mode for Emacs that shows the last modification date and the author of the current line or the current region in the overlay from git.

The package can be slow on very large repositories, so I'm testing asynchronous functionality now and plan to make a release early next year.


### Turbo-log
https://github.com/Artawower/turbo-log

A simple and dumb package based on tree-sitter for one goal: to quickly insert a log message for the current line! Currently supports python, typescript, javascript, golang, c#, rust, ruby, java and partially elisp


### File-info.el
https://github.com/Artawower/file-info.el

When I started using Emacs, I realized that I really like minimalism in the user interface. After a while I realized that I didn't need modeline, first because it was a bit distracting, and second because it didn't contain all the necessary information about the current file when I looked at it.

I made this package to display all the necessary information about the current file with pretty hydra posframe. It uses many external packages like projectile, lsp, vc-git and wakatime.


### Persisten-kmacro.el
https://github.com/Artawower/persistent-kmacro.el

Package for storing and executing macros between sessions.


### Quicktype.el
https://github.com/Artawower/quicktype.el

Just a wrapper around https://quicktype.io/ for generating types from json.

### Orgnote
https://github.com/Artawower/orgnote


This is not just one package, it is a service and a mobile/web application to work with org-roam and org-mode on your mobile devices.

This project is in early beta testing and may contain some bugs and issues. Feel free to join the waiting list to become a beta tester https://about.org-note.com/.


### Some other packages
I didn't publish this packages yet, and mostly made it for myself, but maybe someone will find it useful.

https://github.com/Artawower/wakatime-ui.el - display info about wakatime in the modeline
https://github.com/Artawower/buffer-hop.el - quickly switch between buffers (this is prototype and frankly it doesn't work as well as I'd like it to.)
https://github.com/Artawower/ts-hopper.el - code navigation by treesit

Previous advent calendar: [day 20](https://www.reddit.com/r/emacs/comments/18mn6n9/emacs_advent_calendar_day_20_prots_packages/), [day 17](https://www.reddit.com/r/emacs/comments/18kx1wj/emacs_advent_calendar_day_17_companymode_vc/), [day 16](https://www.reddit.com/r/emacs/comments/18k5c3c/emacs_advent_calendar_day_16_trevokes_orggtd/), [day 15](https://www.reddit.com/r/emacs/comments/18ipu9w/emacs_advent_calendar_day_15_alphapapas_emacs_and/), [day 14](https://www.reddit.com/r/emacs/comments/18hxs9a/emacs_advent_calendar_14_indentbars_kindicon/), [day 9](https://www.reddit.com/r/emacs/comments/18ebqrn/emacs_advent_calendar_9_devdocs_codecells_drepl/), [day 8](https://www.reddit.com/r/emacs/comments/18e945f/emacs_advent_calendar_8_emacsgoodnight/), [day 7](https://www.reddit.com/r/emacs/comments/18dh631/emacs_advent_calendar_7_ordeless_embark_10_and/), [day 6](https://www.reddit.com/r/emacs/comments/18c8c54/emacs_advent_calendar_6_elfeedtube_popper/), [day 5](https://www.reddit.com/r/emacs/comments/18bde31/emacs_advent_calendar_5_advent_of_code_helper/), [day 4](https://www.reddit.com/r/emacs/comments/18az0r7/emacs_advent_calendar_4_chordpromodeel_v220/), [day 3](https://www.reddit.com/r/emacs/comments/189mutf/emacs_advent_calendar_hyperdriveel_v030/), [day 2](https://www.reddit.com/r/emacs/comments/189f9si/emacs_advent_calendar_2_cyclekey_quickly_cycle/), [day

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

/r/emacs

Shoud cpu usage raise to 10% when opening file with emacs without any customization. This is happening even on fast apple M1.

Compared to neovim, in emacs there more CPU spikes when editing files.

https://redd.it/18pyy6k
@r_emacs

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

/r/emacs

Lite templates got lighter

Two days ago I wrote a small experiment that lets me include Lisp as a template placeholders. It looks something like this:

1 + 2 = {{ 3 }}
1 + 2 = {{ (+ 1 2) }}
1 + 2 = {{! escaped }}

I used Mustache-like syntax, to basically just delimit Lisp region from the rest of the text. However, due to Lisp paranthesized syntax it is possible to simplify it. I have now re-written it so it just needs one marker to mark which expression is to be evaluated as Lisp:

1 + 2 = %%3
1 + 2 = %%(+ 1 2)
1 + 2 = %%!escaped

Due to Emacs being a text processing toolkit and a Lisp repl/environment, that basically let us use Emacs Lisp as a template language in text files. The intended use is file and code generators.

The simplified syntax turnes out to be slightly harder to process than the one with start and end delimiters, however I think it might be worth, so here is an experiment to test the idea.

Download and details about the usage details are in online repo.

I appreciate critique and discussion, especially if you find a bug or some fundamental problem.

https://redd.it/18pu13c
@r_emacs

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