This channel is a feed for r/emacs. @r_channels @reddit2telegram
Weird indentation in python-ts-mode?
​
https://preview.redd.it/c29elcgoygfc1.png?width=1914&format=png&auto=webp&s=d383174d5a35b198adad3264b6bde1238a75e11e
My configuration:
(use-package python-ts-mode
:hook ((python-ts-mode . eglot-ensure))
:mode (("\\.py\\'" . python-ts-mode))
:interpreter ("ipython" . python-ts-mode))
(use-package conda
:after python-ts-mode
:ensure t
:config
(setq-default conda-env-home-directory
(expand-file-name "~/miniforge3")))
(use-package pyvenv
:after python-ts-mode
:ensure t)
I don't have any particular indentation related packages or modes enabled beyond stock python-ts-mode, so what's going on here? Whenever I start a new line it jumps to that point on the screen?
Any help is very much appreciated!
https://redd.it/1aeal2i
@r_emacs
LLMs for editing: structured org-mode interactions
To follow up on my previous demo of text editing, I have a new demo on using LLMs to manipulate org-mode in a structured way.
This shows using LLMs to produce JSON, which I then turn into both subheadings in the first part of the demo, and task estimates in the last part. This is part of an effort I'm making to find a good way to support more complicated LLM interactions than we've seen so far. This one isn't just showing the ability to get structured output, but also the ability to refine the previous results as part of a "conversation" with the LLM that started in the first interaction. I haven't seen these things being done before, but I may be missing something. The details and code links can be found in https://lists.gnu.org/archive/html/emacs-devel/2024-01/msg01134.html.
https://i.redd.it/sxwqe5nmsefc1.gif
https://redd.it/1ae0006
@r_emacs
New package: chromecast.el
I created my first transient menu to control a chromecast from Emacs!
chromecast.el
​
Transient menu for interacting with a chromecast-enabled device
https://redd.it/1ae4g75
@r_emacs
Easiest way to assign a system-wide org capture shortcut on windows ?
I want to capture things without running emacs first. (emacs daemon is running)
Found some older posts about this but couldn't make it work.
Does anyone have a practical solution for this ?
Thanks
https://redd.it/1ae19rb
@r_emacs
Repeat-mode is awesome, share you useful configs
(use-package repeat
:config
(setq repeat-on-final-keystroke t)
(setq set-mark-command-repeat-pop t)
(repeat-mode 1)
(defvar isearch-repeat-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "s") #'isearch-repeat-forward)
(define-key map (kbd "r") #'isearch-repeat-backward)
map))
(dolist (cmd '(isearch-repeat-forward isearch-repeat-backward))
(put cmd 'repeat-map 'isearch-repeat-map))
(defvar buffer-navigation-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "n") #'next-line)
(define-key map (kbd "p") #'previous-line)
(define-key map (kbd "f") #'forward-word)
(define-key map (kbd "b") #'backward-word)
(define-key map (kbd "u") #'scroll-up-command)
(define-key map (kbd "d") #'scroll-down-command)
map))
(dolist (cmd '(next-line previous-line forward-word backward-word scroll-up-command scroll-down-command))
(put cmd 'repeat-map 'buffer-navigation-map)))
You wanted to master Org mode someday, but never 'grokked' it? Then this might be a good course.
EDIT: I got the remark it was too close to an advertisement, so I adjusted my opening post.
For context: I'm an avid Emacs user, but I never felt compelled to use org-mode since it was too overwhelming and I just want to edit text with my polished Emacs configuration, with some Magit sessions here and there. Few years ago I tried the org mode tutorial again on the Org website. I could understand all of it. But Org-mode was not needed for my situation, I assumed. And I actually don't want to put more more time into org-mode, I'm already busy with zillion other things.
Recently someone referred Rainer's videos to me on Udemy. When I saw the disclaimer on Udemy if the org-mode course wasn't satisfactory enough for me, then on Udemy I can claim my purchase back anytime within 30 days. To test it for free, I bought the course for $12,99/ 12,99 EUR (this is what you get if you try Udemy course for first time with new account). If you might not find time to finish the course, then you could claim the money back.
I tried to watch only one video (which is sometimes between 5 and 10 minuted) per day, which worked well for me.
I found the accent of the explainer bit hard to follow (I'm deaf by the way), but the subtitles were helpful for me in this case. Sometimes I had to pause a bit to try it out with the org files that the /u/rakoenig provided in the course within my Emacs setup. That helped me to understand it better.
Currently I'm using org-mode in a productive way. Now I wished someone would recommend this course earlier, because I never could 'get' the official tutorial on Org mode website. To give a good example by myself, I could give this as advice, you can find the Udemy course here if you would like to try out too :-).
Anyone here that can suggest a better course to learn Org-mode, next to the current tutorial on Org mode website?
https://redd.it/1adrzja
@r_emacs
GNU Emacs as a Comic Book Reader
​
https://preview.redd.it/fhv2rib2hcfc1.png?width=762&format=png&auto=webp&s=7381cb659a874f15d8ecdfd243642598966a2992
Use GNU Emacs as a comic book reader for CBR and CBZ formats.
Details: https://lifeofpenguin.blogspot.com/2024/01/gnu-emacs-as-comic-book-reader.html
https://redd.it/1adr17q
@r_emacs
Temporarily Make Single Buffer Fullscreen
"An Emacs function to temporarily make one buffer fullscreen. You can quickly restore the old window setup."
(defun toggle-maximize-buffer () "Maximize buffer"
(interactive)
(if (= 1 (length (window-list)))
(jump-to-register ')
(progn
(window-configuration-to-register ')
(delete-other-windows))))
Copied from here :)
https://redd.it/1adn8j6
@r_emacs
Is anyone using the slack layer in Spacemacs successfully?
I've tried several times to get it working but I always get the error:
Failed to request slack-authorize: invalid_auth
I've included slack in my dotspacemacs-configuration-layers, and here is what I have in my dotspacemacs/user-config (with personal parts redacted):
(slack-register-team
:name "emacs-slack"
:default t
:client-id "xxx@xxx.com"
:client-secret "xoxd-xxxxxxxxxxxxxxxxxxxxx"
:token "xoxc-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
:subscribed-channels '(general slackbot))
I got the client-secret and token by following the direction in the [emacs-slack](https://github.com/yuya373/emacs-slack/blob/master/README.md#how-to-get-token-and-cookie) package (as directed by the spacemacs slack layer documentation).
There does seem to be some differences in nomenclature between the spacemacs layer and emacs-slack, maybe I'm entering the wrong thing? And the instructions for the spacemacs layer doesn't go into enough detail. Is name suppose to be the name of the slack team I use? Is client-secret the same as the d cookie from the emacs-slack instructions or is it my password?
If someone has it working could you provide a copy of your user-config entry (with the personal stuff redacted of course, but not so much that I can't tell if I'm doing it right or wrong.) and maybe some details about each of the items?
It does seem that emacs-slack isn't under development any more, maybe it just doesn't work anymore?
https://redd.it/1adjveg
@r_emacs
How small can an Emacs frame be, and the windows within the frame?
https://redd.it/1adijx2
@r_emacs
how to temporarily toggle the face, height specifically, between two states. any help elisp wizards?
## the problem
so i have this in my doom emacs org mode setup which make the headings a bit bigger then other stuff
(with-eval-after-load 'org
(dolist (face '((org-level-1 . 1.3)
(org-level-2 . 1.2)
(org-level-3 . 1.1)
(org-level-4 . 1.05)
(org-level-5 . 1.1)
(org-level-6 . 1.1)
(org-level-7 . 1.1)
(org-level-8 . 1.1)))
(set-face-attribute (car face) nil :weight 'bold :height (cdr face))))
What do you use for help / describe (function, variable, etc) ?
Title. I often use M-x describe-function, M-x describe-varialbe, etc. Wonder
-, if i could combine them in one (cause sometimes name can be missleading and function can turn to be variable, etc)
-, also is there a way to get docs for general elisp (and also python) functions directly in emacs? Now i google search.
https://redd.it/1ad0m8o
@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/18xebux
@r_emacs
Remove ANSI escape sequences from shell process output?
After sending a string to a `shell-mode` process, the output received by a process filter function includes ANSI escape sequences. I would like to remove those with Elisp so that I can use the output for a completion I'm trying to display in the shell.
​
Is this possible or do I need to resort to processing the output with another program outside of Emacs like `sed`?
https://redd.it/18xaakz
@r_emacs
Set cursor color for all frames, not only the selected one
I try to set the cursor color in my init.el by adding the following line last in init.el;
(set-cursor-color (doom-color 'yellow))
I use a theme from the doom family, hence the doom-color
call.
This does not work, the cursor color is not yellow when Emacs starts. If I evaluate this piece of code after startup, the cursor will shift to yellow. I suspect this is caused by set-cursor-color
setting the cursor color for the selected frame, only.
The documentation for set-cursor-color
says;
You can also set the text cursor color, for all frames, by customizing the cursor face.
I have tried to figure out how to do this, without success. How do I change the cursor color for all frames?
https://redd.it/18wrje3
@r_emacs
Emacs search, ignoring punctuation or spaces between words: M-s w
https://redd.it/1ae8z4r
@r_emacs
New Prot Video: define prefix/leader key
https://www.youtube.com/watch?v=gojOZ3k1mmk
https://redd.it/1ae0khl
@r_emacs
Help someone that never used Emacs
Hello everyone, I'm never used Emacs, i pass from the normal IDE to VIM to NVIM, but i always thinks you are to try something to understand if you like it more or less, so i decide to try emacs, and i read about doom emacs, so i want to try to create my enviroment, i'm a full stack and i use python, php, java, js, ts in my job. I don't find so many guide, you know some video tutorial or text guide that help to learn emacs basic and config in base your language doom emacs at the best?
https://redd.it/1adzz73
@r_emacs
Switching to the meow modal editing system from evil
https://esrh.me/posts/2021-12-18-switching-to-meow.html
https://redd.it/1ady8st
@r_emacs
Auto-revert PDFs in Emacs
https://zck.org/auto-revert-pdfs-in-emacs
https://redd.it/1adwfgf
@r_emacs
Logseq from an Emacs Org-mode perspective
Hi,
So far, I failed to motivate my dear wife to use GNU Emacs with Org-mode for her knowledge-management.
Therefore, I had to look for alternatives. I looked into Joplin and Logseq and summarized my findings on my blog: https://karl-voit.at/2024/01/28/logseq-from-org-pov
I hope you don't mind the slightely off-topic character.
https://redd.it/1adrg9u
@r_emacs
How to use "foreign layout" while not messing up the shortcuts?
Probably it's been asked many times, still, I'm not sure which way should I go.
I'm hungarian, and my solution to write hungarian in emacs (which I have barely done) was that I just simply typed "auoeiuo" instead of "áúüű....".
Lately I started to have the need to write text for others, so using the correct vowels with "umlauts" became needed more and more often. It would be amazing if I could just simply switch layout and go on with my life not fighting with my muscle memory. Most often I still use us layout, not only because of the shortcuts, but also typing special characters like \\, [\], etc... on hungarian layout really a pain in the ass. On hungarian layout I will almost never use any "programming characters", I'm pretty sure.
The problem I have for example is that "C-_" is "C-Ü" or "C-y" is "C-z" on hungarian layout, which doesn't work anymore. I don't want to learn different combinations, neither fighting my muscle memory every time when once a week I want to write some longer hungarian text in emacs.
I have a feeling that there could be a trick that any time i'm using a different layout, (and probably I should also put a condition that I'm in txt mode for not mess up things like dired or magit), emacs would interpret my keystrokes differently when I hold down C or M. So I would use the same key for typing a single "ü" and "C-_" for example.
What could be the simplest way to set up emacs like that? Can you post me a link where it's already answered? I'm pretty sure it's been answered a couple of times, I'm just too stupid to find it.
Thank you!
https://redd.it/1admvv1
@r_emacs
kill-compilation is acting up
My elisp-foo is weak and something that I've done in my startup is messing with kill-completion. If I toggle debug on error and then M-x kill-compilation in a brand new session I get:
````
Debugger entered--Lisp error: (wrong-type-argument char-or-string-p ("ELisp" (lexical-binding (:propertize "/l" help-echo "Using lexical-binding mode") (:propertize "/d" help-echo "Using old dynamic scoping mode\nmouse-1: Enable lex..." face warning mouse-face mode-line-highlight local-map (keymap (mode-line keymap (mouse-1 . elisp-enable-lexical-binding)))))))
kill-compilation()
funcall-interactively(kill-compilation)
#<subr call-interactively>(kill-compilation record nil)
call-interactively@ido-cr+-record-current-command(#<subr call-interactively> kill-compilation record nil)
apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (kill-compilation record nil))
call-interactively(kill-compilation record nil)
command-execute(kill-compilation record)
execute-extended-command(nil "kill-compilation")
smex-read-and-run(("kill-compilation" "toggle-debug-on-error" "package-list-packages" "package-refresh-contents" "magit" "undo" "shell-script-mode" "outline-toggle-children" "insert-char" "speedbar" "popper-mode" "elfeed-unjam" "eval-region" "describe-char" "hs-minor-mode" "outline-minor-mode" "sk/elfeed-search-remove-selected" "text-mode" "popper-cycle" "outline-cycle" "python-mode" "hs-toggle-hiding" "outline-cycle-buffer" "speedbar-mode" "eglot" "org-mode" "outline-mode" "revert-buffer" "flymake-goto-next-error" "describe-face" "describe-variable" "whitespace-cleanup" "imenu" "locate" "sort-lines" "auto-fill-mode" "eglot-shutdown" "eglot-reconnect" "org-indent-mode" "find-file-at-point" "ffap" "whitespace-mode" "er/expand-region" "help" "find-file" "grep-find" "load-theme" "delete-file" "helpful-key" "remove-hook" ...))
smex()
funcall-interactively(smex)
#<subr call-interactively>(smex nil nil)
call-interactively@ido-cr+-record-current-command(#<subr call-interactively> smex nil nil)
apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (smex nil nil))
call-interactively(smex nil nil)
command-execute(smex)
````
I think just the first line of that is pertinent but it's gabberwock to me. I tried 'emacs -Q' and it runs OK - hence I suspect something in my config. Any ideas on tracking it down?
The config is at https://gitlab.com/wef/dotfiles/-/blob/master/.emacs.d.minimal/config.el but it's huge.
https://redd.it/1acy98t
@r_emacs
How to replace in-paragraph newlines (etc) with single spaces?
When typing up some long-form text for entry into a website, I'll sometimes do it first in Org mode and then once I'm happy with it I'll copy-paste it into whatever I'm using.
However, one issue is that of <NEWLINE>.
On the one hand, web forms often want to handle line wrapping, and so it wants the user to insert <NEWLINE> characters only if really necessary; e.g. for between paragraphs, list items, and so on.
But on the other hand, I have Org set up to auto-fill text input (and I'll also regularly give it a hand in that using M-q
to run org-fill-paragraph
), so I end up with <NEWLINE> characters all over the place.
Now obviously I could just turn off emacs and Org's auto-fill for the purpose of these situations. But I don't want that. I actually *want* the Org text formatted with the auto-fills, just as it would be if I wasn't creating something for input on the web.
So, is there a simple way (maybe using export? ) to have the newlines that are not needed (I'm thinking it's only newlines within a paragraph) replaced with what is almost certainly going to be a simple inter-word space? Note , though, that it isn't just going to be the newline that needs to go, but also any following indenting whitespace characters used to correctly position the next piece of text.
For example, I'd like to have this:
1. A line of text
2. Another line of text but this one is long enough to need to be
wrapped. And notice that this portion is indented.
1. A line of text
2. Another line of text but this one is long enough to need to be wrapped. And notice that this portion is indented.
Is there a way to make a dynamic MOC/Index based on tags in org-roam?
I like org-roam but in the process of my obsidian files to oeg-roam i found it hard to make a "dynamic index"
in obsidian there is this plugin that makes a "folder note" (basically a note for each folder that has indexes of all other notes in the same folder)
now i like the free flow of org-roam and i can have all my notes in the same directory. But i want to dynamically index all notes with the same tags for example or the same property,
is there something like that in org-roam?
https://redd.it/1aczaci
@r_emacs
Can i build emacs with newest org?
I have tried cloning the emacs repo, deleting the contents of org, and replacing them with the contents of the org development repo, but make all fails with status 2. Is there a way to do this?
https://redd.it/1ad83zk
@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/19ec8v5
@r_emacs
Is evil-mode worth committing to as a vimmer learning emacs?
Hi all!
I recently have started learning emacs. I did the built-in tutorial and followed a couple of SystemCrafters’s “Emacs From Scratch” videos, and I’m facing a dilemma right now.
Of course, evil-mode is hugely popular and has a lot of support, often being called the best vim emulator. Even SystemCrafters uses it, which to me, is a big vouch for using it.
However, in reading some other reddit posts about others asking this same question, many people said that it had compatibility issues with some plugins, and relying on vim emulators has always left a bad taste in my mouth from other editors. Also, as a new emacs user, I don’t know how much of the emacs experience changes with evil-mode, and I don’t have the knowledge to be able to thoroughly understand and debug any issues that might come up from using it.
So, I’m mostly just looking for some affirmation and anecdotes, good and bad, about evil-mode: if it will hurt me as a new user, and generally any heads-ups that could help me. Thank you!!
https://redd.it/18xbmqf
@r_emacs
Trying to fix a screwed up config file
Hello everyone. I suppose the solution to my problem must be fairly easy, but I've only recently started using Emacs for both coding and org mode, and I need some help with my config file.\\
Basically, I have a ".emacs" file that I started configuring through tutorials about a month ago. At the time, all I did was assemble together different elisp snippets from different configurations that I found online and liked. Inevitably, I accidentally created a kind of Frankenstein. My main problem is that I have contradictory information in (custom-set-faces) and (custom-theme-set-faces). Now, when I try to change something, it starts accumulating contradictory information and randomly selecting which one to pick.
I want to clean up my config file, possibly try literate configuration. The problem is that I fear losing all my current configuration and being left with nothing, having to restart from scratch. Can anybody lend me a hand or share some resources?
Here's my configuration, if you'd like to take a look. Thanks a lot.
https://redd.it/18wv8it
@r_emacs
Learn irregular English verbs in Emacs
https://github.com/tanrax/learning-irregular-verbs-in-English.el
https://redd.it/18wsobq
@r_emacs