repl for javascript?
i've been looking for good repl for javascript.
Something like Slime
or Cider
or m-x run-python
.
it needs to support:
- auto completions in repl
- auto completions in buffers that are connected / associated to js repl process
- multiple repls
- code navigation (optional, i know its hard to implement)
I've been only able to find abandoned and/or non-working projects
- https://github.com/NicolasPetton/Indium (didn't work)
- https://github.com/Gozala/slime-js (abandoned)
- https://github.com/skeeto/skewer-mode (no auto-completion)
- https://js-comint-el.sourceforge.net/ (no auto-completion, no associated buffer auto completion)
- https://github.com/abicky/nodejs-repl.el (no associated buffer auto completion)
note: lsp is not what i'm looking for.
https://redd.it/1g83552
@r_emacs
Dired elisp function for regexp marked files
I try to make a function for Dired that list only some files having some keywords in the filename. For instance in a folder I have some files listed in dired formatted like "Interactive Chart in Excel - Dashboard Reporting Tips\_\_Excel.mp4", I would like to do an interactive function that retrieve all keywords prefixed by two underscores (in the example "Excel"). The user should selected a keyword from list retrieved and then mark all files containing the keyword.
I try with this function but it's not working as expected. Could you help me on this ?
(defun my-dired-filter-by-keyword ()
"Filter Dired files based on a chosen keyword from filenames."
(interactive)
(let* ((files (directory-files default-directory nil "^[^.].*")) ;; Get all files, excluding those starting with '.'
(keywords (cl-remove-duplicates ;; Use cl-remove-duplicates to avoid duplicate keywords
(delq nil ;; Remove nil entries from the resulting list
(mapcar (lambda (file)
(when (string-match "\(__\)\(.*\)\([\.]\)" file)
(match-string 2 file))) ;; Extract the keyword
files)))))
(if keywords
(let ((keyword (completing-read "Choose a keyword: " keywords)))
;; Filter Dired based on the selected keyword
(dired-mark-files-regexp (concat "__" (regexp-quote keyword) "\\."))
(dired-toggle-marks)
(dired-do-query-replace-regexp (concat "__" (regexp-quote keyword) "\\.") "" nil)
)
(message "No keywords found."))))
https://redd.it/1g7va2l
@r_emacs
Accessing Podman Containers in Emacs
I did a little bit of research in this, and apparently docker-tramp https://github.com/emacs-pe/docker-tramp.el can allow someone to access docker from within emacs and but now this feature is built-in in emacs >= 29. The reason I brought up even docker tramp is the website also emacs that can someone same things with podman for these emacs version. I know there is a docker package in emacs allows it to manage docker containers witihin emacs. But I don't need that level of control for podman. What do I need, as the title says, is to access the podman containers. To clarify futher, what I want to do is when I am working on a project and say I want to evaluate a snippet of code using C-c C-c, I don't want emacs to use my system's environment but the environment of the specific container I would like to use. I tried researching on this but I could not find any example code since I don't know lisp to write my own. But I really use anyone's help in writing one. Maybe, since docker and tramp are related, going through tramp manual I might some help. But has anyone here tried setting up emacs the way I want and used podman? And would it be easy to set up like that?
https://redd.it/1g7rqcm
@r_emacs
How does Prot's Ef themes set the colour and width of the window divider?
The color and width of the window divider set by Prot's theme is too narrow for my liking and for some reason the function I use to set it cannot change the colour and widen to my preferences.
I believe his themes use a different method for that.
Here is the code I use to set mine. I don't know of there are some additional settings used for the borders my code doesn't account for.
(defun set-window-borders-config()
(setq window-divider-default-places t)
(setq window-divider-default-right-width 4)
(setq window-divider-default-bottom-width 4)
(set-face-foreground 'vertical-border "green")
(window-divider-mode)
)
https://redd.it/1g7n0c1
@r_emacs
Emacs purple theme inspired by Plasma cookies
I live in Serbia and I like local cookies Plasma. Yesterday I saw how this colors combination is pretty. And firmly decided "I'll do this!".
It was my first time creating color scheme and as templates I used other themes which were under my hand.
What you think about it?
https://github.com/Prikaz98/plasma-theme
https://preview.redd.it/9ogyxko0dqvd1.png?width=500&format=png&auto=webp&s=ea281e026ae84aa8631b052d54c5b45ddac3731e
emacs
doom-emacs
https://redd.it/1g7b6mn
@r_emacs
Developers Have Jobs To Do: Part 2
This is a continuation of the thread [Developers Have Jobs to Do](https://www.reddit.com/r/emacs/comments/1g6htoz/developers_have_jobs_to_do/).
I took the time to document my experience installing emacs and bedrock, and configuring it for python development. The immediate goal is great Emacs support for python developers accessible via Github.
[https://github.com/gregfelice/emacs-dx/blob/main/emacs-dx-profile-python-developer.md](https://github.com/gregfelice/emacs-dx/blob/main/emacs-dx-profile-python-developer.md)
A summary analysis:
* bedrock can be an accelerant leading to a good experience for python.
* work needs to be done to get to a good python development ux out of the box.
* external dependency guidance (and hopefully more automated setup) is critical.
Next steps:
* get in touch with bedrock authors. see if they could help answer some of the questions raised by the research.
* get feedback from community: [emacs-dx issues](https://github.com/gregfelice/emacs-dx/issues) is open on github. feel free to create an issue if 1) you have some guidance (or code) that solves a problem raised by the research 2) you have something you'd like to see offered in the python developer profile.
Thanks.
https://redd.it/1g79nqc
@r_emacs
Have anyone customized org startup options?
I just discover org-margin. I think it would be nice if I can use org margin just like org indent mode with startup options.
I tried to look at how startup options works, but I found out that it was not designed to be easily customized. Have anyone done the customization of startup options before?
https://redd.it/1g71jjp
@r_emacs
Emacs + TRAMP insists on using the wrong file endings for a shell script.
I've googled for about 1.5 hours and I can't find a solution for this. Using my local MacBook to edit a file with Emacs on a remote MacMini via SSH+Tramp:
^X^F/scp:mac-mini:bin/new-shell-script.sh
When I open the file, Emacs automatically changes the file-endings to 'Mac' conventions: Mode line:
U(Mac)...
This is the wrong file ending convention and the script will fail when I try to run it which results in a head-scratching debugging session. Clicking the 'M' and U(Mac)...
changes the file ending standard to utf-8-unix and saves the file but then Tramp immediately changes the convention back to the wrong file ending conventions. This sets me up for another WTF debugging session. I've tried setting the file conventions with a local buffer variable but that doesn't help as the file immediately reverts to Mac line endings after each save. I have two questions:
Q: First, I'm just looking for a work around here. Can I put something into my:
# -*- mode: shellscript; ... -*-
mode line that will force my desired file ending convention? Emacs and Tramp seem to be convinced that in this environment is should be utf-8-hfs-mac
when I want utf-8-unix
. I'm looking for a file-local temporary fix here but google seems to be convinced that I'm better off chasing the setting of these variable each time I have a problem like this and I do actually use TRAMP to edit files on foreign filesystems irregularly. So, most of the time TRAMP gets this right, it's just that this time, TRAMP is getting it wrong which is adding 3 items to my debugging stack making a simple problem hard to debug.
Q: Second, I've searched for about 1.5 hours along the subjects of "emacs line endings", "emacs normal mode", "emacs mode-line" and none of them have answered my question. What subject should I be searching for to fix this?
https://redd.it/1g6x860
@r_emacs
Ultyas - Convert Ultisnips snippets to Emacs YASnippet format (Release 1.1.0)
https://github.com/jamescherti/ultyas
https://redd.it/1g6m5tt
@r_emacs
Developers Have Jobs to Do
Hi community. I've used Emacs for over 30 years. I've recently started using it again for python and react development. While I love some of what Emacs has to offer, it's continued to be a frustrating and problematic ramp. It's hard to get it where I need it as a professional developer.
Even after all these years, I still feel Emacs has so much untapped potential, but there's problems holding it back.
Rather than just walk away, I decided to write up and share my ideas. I want to give back to Emacs by collaborating on a solution that gets it used and driving real value for more people.
The document shares ideas on how to help developers quickly get productive with Emacs on the tasks that matter to them. I deeply believe we can increase the number of developers who try Emacs, get value quickly enough to use it more, and promote its virtues to friends.
https://github.com/gregfelice/emacs-dx/tree/main
Comments are welcomed here or in discord. https://discord.com/invite/9F4DSE25r7
https://redd.it/1g6htoz
@r_emacs
That Lightbulb Moment with Emacs
Context: Novelist/filmmaker who primarily uses NeoVim for all my prose and screenwriting, and for note-taking via Zettlekasten system since 2020. I also put together a an Integrated Writing Environment (IWE) for NeoVim for other users like me. I even spoke at a couple of NeoVim confs since then. Suffice to say I love NeoVim.
I also love tinkering with my computers endlessly when I am not working, naturally my brain has always been interested in seeing what emacs can do.
Tried Emacs for the last 3 years, but kept hitting a wall. Or just plain frustration.
Until I tried this Emacs kickstarter for NeoVim users.
And everything clicked.
I had a few _oh shit_ moments the last few days. Can't say I am a convert yet - I still think Vim motions is subjectively better for pure text manipulation - but for pure hackable joy, emacs all the way.
So far:
1. Moved from using Org mode in NeoVim to Emacs.
2. I give myself an hour everyday where I turn off evil mode and just use pure emacs bindings. I still feel like I am playing jazz piano but it is now almost intuitive.
3. Started browsing some documentation sites purely through eww
4. I can control spotify?!
Things that aren't working yet:
1. LaTeX live previewing. Can't figure out why because my Tex installation works perfectly on NeoVim using vimtex. I'll figure it out in a couple of days
Carry on.
TLDR: I (almost) see the light.
https://redd.it/1g6dauf
@r_emacs
Literal programming with org-mode
I'm mostly doing python programming with Python using emacs and LSP.
Sometimes I switch to Code to prototype some notebooks.
Now I thought the last step can also be done in org-mode which suits me better ( No switching to Code).
However, I seem to be loosing all LSP functionalities and basically I'm on my own.
Any idea how I can deal with this inconvenience?
https://redd.it/1g6b7jk
@r_emacs
How to middle-align an element in mode-line-format?
I found there is an mode-line-format-right-align
can let rest element right align, but I want to let one element in mode-line-format align in the middle, is it possible? How?
https://redd.it/1g677ko
@r_emacs
Requestion tips for an "Emacs luddite" in the age of AI
Hello lovely Emacs community,
I've been coding with emacs since 1984. That's a long time. Over the years I've been forced by work circumstances to use various IDE's, including more recently vscode (like everybody) but despite adding "emacs modes" to these IDE's they just were never really just... emacs.
My young coworker asked me this week why in fact do I use emacs. He's a thirty-something and had never even heard of it. I didn't have a great answer... muscle memory? learned in college? macros? it works the same everywhere? highly portable? All these answers are somewhat... outdated these days. That said, whenever I'm forced to use vscode, and even think about a mouse when coding, I loathe it. That hatred of the IDE slows me down. Vscode is so visually busy with so many flyovers and "helpers" that interrupt your train of thought, too. We're editing text here, why can't the tool just focus on getting the text right, as emacs unfailingly does?
But, my coworker pointed out cline and said, what if you could go a lot faster with this tool (which AFAIK has no emacs integration), would you switch? And what about rapidly jumping to any function or file within an entire project (which IDO doesn't do unless you already visited the file), and what about super fast global refactors ... and so on and so forth yadda yadda.
So my question to the community is, what are you doing to make coding with AI and emacs faster? What can I add or change in my rarely updated init.el that would help me go faster coding along with AI?
The way I code now is, I ask Claude/OpenAI questions in their webIDE and cut and paste back and forth. On the plus side, this forces me (somewhat) to pay attention to the actual code being generated, some of which can be totally wrong/crappy, vs just being totally hands off as you might be with Cline. OTOH, I can't deny doing things in this manner is pretty slow. And with the WebAI's 5 attachments limit, the AI doesn't have access to the whole codebase which means a ton of gaps in what it's doing/thinking.
Any and all suggestions you might share about how you do modern AI-assisted coding (esp webdev) with emacs will be appreciated!
https://redd.it/1g5ydk3
@r_emacs
Why do you think emacs is so low in popularity?
https://survey.stackoverflow.co/2024/technology/#1-integrated-development-environment
Emacs being lower than nano actually surprised me
https://redd.it/1g5t9h7
@r_emacs
Is it worth learning emacs keybondings?
As a user of doom emacs and previously using vim to edit files quickly, I found it easy to use the vim keybindings in other text editors and programs.
I heard that the emacs keybindings are quite useful aswell but also heard that they are quite hard with a soft pinky finger.
I do not know the emacs keybindings and it would be easier to use it in the emacs environment as it was designed to be used there but is it really worth all the trouble?
https://redd.it/1g7uqcl
@r_emacs
Getting auto complete for compile command with vertico
Hey everyone, I've wanted to use the `compile` command for a while but I found it annoying that it doesn't give you auto complete based on previous commands you have run. I tried to search how to get this effect since I assumed other would have wanted it too but to my surprise my google-foo failed me.
I ended up reading some emacs docs and to my surprise it wasn't that hard to do, so I want to share my solution here, potentially to help others who care about this and maybe to get feedback on my solution since over all I'm relatively new to 'hacking' emacs.
My solution involves overwritting the `compilation-read-command` function to hook it up with `completing-read`, and since I use vertico I get a nice completion ui around it in the minibuffer.
;; compilation-read-command uses read-shell-command
by default, which doesn't use
;; completion at all. So I overwrite it to use completing-read
instead, which seems to work great.
(defun compilation-read-command (command)
(completing-read "Compile command: " compile-history
nil nil command
(if (equal (car compile-history) command)
'(compile-history . 1)
'compile-history)))
https://redd.it/1g7tp3c
@r_emacs
Doom Emacs Windows 10 Question
I've recently followed the getting started guide to install Doom Emacs on Windows 10 but ran into an odd issue that I'm wondering if others have seen/know the answer to.
So within Emacs itself, attempting to reload with either "doom/reload" or "SPC h r r" opens up Notepad with "doom.ps1", the Powershell file. Closing the Notepad window prompts the "config successfully reloaded!" message in Emacs, but fails to load any changes.
Does anyone know what the deal is with that?
https://redd.it/1g7otvw
@r_emacs
How to add custom links to files to the agenda?
hi everybody
I am trying to create a custom section to the agenda. My goal is to add some hyperlinks to files in this agenda. I am able to create the section and add text with properties, but I have discovered that org-mode style links do not work (they are simply rendered as text).
Does anybody have any recommendation on where to look for information on how to do this? Ideally I would like to insert links similar to those already supported in org (eg. [uridescription]).
thank you
https://redd.it/1g7hf93
@r_emacs
Auto-completion in Terminal (doom)
Hey all. When using emacs in a terminal (with -nw option), are you meant to see the autocompletion drop down suggestion list as you type? Similar to neovim? I only see this behavior when running in the emacs client but not the terminal. Am I missing something or is the maybe a problem with doom emacs?
https://redd.it/1g78wqu
@r_emacs
Magit: How to Push to Github?
Hello.
I've been trying to use Magit more and wean myself off og github desktop recently, but there's one thing that has been bugging me. Magit seems to only accept password credentials for github pushes, but password credentials to push to github have been deprecieated. Is there any way around this? Thanks in advance.
https://redd.it/1g7282d
@r_emacs
Change the ellipsis in outline-minor-mode/hs-minor-mode
I have been searching a way to change the ellipsis (the "...") shown by hs-minor-mode. It turns out the solution here solves my problem. I hope this can help people with the same issue.
By the way, hs-minor-mode
is a good built-in code folding package. If you don't want a minimal setup, try this one!
https://redd.it/1g70btp
@r_emacs
Syntax highlighting major mode that is syntax aware
I'm trying to create a major mode for syntax highlighting a query language that I use. However, the language has highlighting of variables in very different contexts. Where regular expressions might work, it feels far too complicated to use.
The way forward, it seems, would be to use something that is syntax-aware. This realistically seems like the only way to do what I want.
I asked ChatGPT and it suggested tree sitter. I know that tree sitter support is now natively in Emacs as of 29.1. I've never used it before.
Is tree sitter the best thing to use for creating a syntax highlighting mode that is grammar-aware? Or would there be another way?
https://redd.it/1g6uwc2
@r_emacs
Interview with an Emacs Expert
Not sure how many have seen this, but--if you're an Emacs user, it's hilarious.
https://www.youtube.com/watch?v=urcL86UpqZc
https://redd.it/1g6kvm7
@r_emacs
HTML Renderer: CSS Support
https://preview.redd.it/wylnk0a0thvd1.png?width=682&format=png&auto=webp&s=d6e7fc99e6a28ee32ab3acb8b90569465c78ee91
Limited CSS support.
Details: https://lifeofpenguin.blogspot.com/2024/09/html-renderer.html#css
https://redd.it/1g6ey96
@r_emacs
(async || witheditor) + org mode init
I was reading a lot about the multithreading is not necessary or maybe it is implemented with (heavy) threads in emacs. If I red well we can use the async package and reach the "async" functionality with it ...
So my question is that how I can preload the org mode in the background ?
use case:
I open the emacs every morning and I start to read a file or do something ...
I used to open my daily.org file but I have to wait a lot because to load the org package is very slow (\~5-10 sec)...
I'm using win10 or win11 and I know it is because the windows os but I thought that maybe we can preload the org mode in the background :)
do you know any solution for this ?
If I think well the witheditor is working like I open a file with emacsclientw.exe ... so maybe I can use this one to preload the daily.org in the background ...
I don't know what is the trick in the async package so maybe any guidance is needed if I can solve this issue with this package ...
I know we should load a package in the ui thread but what is if I open an org file with an emacsclient, will it freeze my every emacs frames for this short (5-10sec) period ?
https://redd.it/1g6bsv6
@r_emacs
Emacs Terminal Setups Discussion
Been using Emacs in various terminals for the past six years with the following setup:
Powershell: Windows terminal emulator, running wsl
iTerm2: macOS terminal emulator
Terminal: whatever is default installed in Ubuntu/Crostini
Termux: terminal emulator on Android, with Unexpected Keyboard (available on F-Droid) for full keyboard
Zsh: cross platform shell with a bunch of plugins for auto completion
Mosh: ssh client that auto-reconnects without losing session information
GNU Screen: Outer layer of multiplexing terminal sessions, allows switching between multiple tmux sessions in a single terminal window
Tmux: Inner layer of multiplexing, hosts various emacs instances for whatever I'm working on
Emacs: default keybindings, MELPA package repo, magit, various lsps (python, typescript, elixir), flycheck, company
On system startup my launch procedure is:mosh
, screen
, tmux
, emacs -nw
Haven't had to change any key bindings and can easily switch through panes/sessions without ever touching my mouse on laptop.
What is your emacs terminal setup?
I haven't changed mine in years, so I'd like to hear about others' setups and try some new things!
https://redd.it/1g68ia2
@r_emacs
Supreme Sexp System - SSS - a Lisp machine adventure with Emacs, Guix, StumpWM, Nix, and more
https://redd.it/1g619jg
@r_emacs
Emacs users, what is your go-to tool for freehand note-taking, doodling, drawing diagrams, flowcharts and all that stuff?
>inb4 pen and paper
https://redd.it/1g5r44a
@r_emacs
Show agenda with last note
Hi there, do you know of any way to have an Agenda view, or Super Agenda, or org-ql that will show entries with the last note next to it (or under it)? And the date of such note.
I have TODO items that can be there for years (ie, awaiting court ruling) and the date & content of the last note is the most useful thing during a review of entries.
https://redd.it/1g5stee
@r_emacs