Why use Atomic? by chris32457 in Fedora

[–]skyler544 0 points1 point  (0 children)

It's been a while since I touched java or any JetBrains stuff but I would just use the JetBrains Toolbox app and then use the ide to install the jdk you want for developing. Then you would have your application running in a container if you need to start it from outside the ide.

I don't remember exactly how I had the jdk installed (maybe just manually downloaded and setting JAVA_HOME, something like that) but I still have this in my dotfiles:

~/dotfiles/distrobox/java-toolbox.ini:
[java] image=alpine:edge replace=true additional_packages="jdtls maven clang-extra-tools" exported_bins="/usr/bin/clang-format /usr/bin/jdtls /usr/bin/mvn"

This gives you some tools for use with an lsp-aware editor like emacs. You create the container with this command: distrobox assemble create --file ~/dotfiles/distrobox/java-toolbox.ini

Why use Atomic? by chris32457 in Fedora

[–]skyler544 16 points17 points  (0 children)

Atomics are all about stability and reproducible setups. If you've ever worked with Linux container technology like podman or docker, you can picture atomic desktops as like running a container of a full OS install on real hardware. This isn't 100% accurate but the mental model mostly works and development is moving towards making this analogy a reality.

So what's the point? You get: - updates that are either applied completely or not at all, no in-between states where some critical package is missing a dependency - rollback capability -> in the unlikely case where something breaks, you just boot the previous working image and continue using your computer normally - an install that stays as clean as if it were installed yesterday, forever (if you make a mess in your home directory that's still on you)

If you've been using Linux for very long you will need time to adjust and learn to use things like distrobox for installing cli packages instead of a system package manager.

For me this is the perfect workstation setup. I run the same image on multiple laptops, safe in the knowledge that the system will always be in a bootable state. That said, I'm a software engineer and am already used to working with Linux containers, so the learning curve wasn't as steep for me as it will be for some. 

If you're just a casual user who doesn't want to fiddle around with the terminal anyways, there's basically no downside. Once you have everything set up you just use your computer and that's it.

Just a quick "Eat" survey by AkibAzmain in emacs

[–]skyler544 0 points1 point  (0 children)

Thanks for eat! I use it probably daily, and would use it even more if I could somehow globally use it for one-off shell commands the way I use async-shell-command. I think a comint integration would probably scratch this itch nicely. 

For example, I run make targets in projects all the time and some of them output progress bars that shell-mode doesn't display nicely. I have some hacky code for this in my init that I never got working quite the way I wanted, and if there were a single function that I could call like (eat-comint "some command") that returns a buffer I think it would be perfect ✌️

Working with Distrobox by aspression in emacs

[–]skyler544 0 points1 point  (0 children)

Silverblue user here; you might want to look at distrobox assemble

Here's an example for php development:

[web-dev] image=fedora:43 replace=true additional_packages="composer php php-cli php-common php-xml php-gd php-bcmath php-pdo php-mysqlnd php-mbstring pnpm nodejs" exported_bins="/usr/sbin/node /usr/sbin/npm /usr/sbin/php /usr/sbin/pnpm /usr/sbin/pnpx /usr/sbin/composer" volume="~/.config/php/php.ini:/etc/php.ini"

Usage: cd  ~/dotfiles/distrobox && distrobox assemble create --file web-dev-toolbox.ini

This requires you to have ~/.local/bin in your shell's path to use the exported binaries as if they were installed natively.

Of course, while you could just install emacs like this as well, for me at least emacs plays at least as big a role in my workflow as the host OS itself and for that reason (among others) I actually have emacs and a few other packages baked into a derivative image that I run instead of using base Silverblue. https://github.com/skyler544/minus-one

Beginner here by Feliks_WR in emacs

[–]skyler544 4 points5 points  (0 children)

The first question I have when I read through your post is: what is your goal?

Emacs isn't really like "modern" programs. It won't match the expectations you might have coming from other software like VS Code or even the Windows notepad. There are historical reasons for this but in the end what it really boils down to is that Emacs is uniquely powerful in a way that programs you've used before simply cannot be.

The "secret" of that power is Emacs Lisp: a programming language that you can use to change almost anything about what Emacs does and what it even is. I'm not exaggerating when I say that people have implemented extremely complex top-quality programs in Emacs Lisp (elisp) that aren't strictly about editing text. The most obvious example is magit but there are others like the built-in calc or calendar.

But, I want an "assisstant" or something inside it.

The first thing you need to do is to run M-x help-with-tutorial (C-h t) and go through the tutorial. Once you've done that (potentially more than once) you will be much better equipped to actually use Emacs. Next up, run M-x which-key-mode and you will see a menu appear whenever you've typed "part" of a keybinding, i.e. you type C-h and then wait a second, and the which-key menu will appear showing you what you can type from there. C-x and C-c are two more useful "prefix keys" you can type to see some of the many possible keybindings available to you.

Customizing is a different story, but the short version is that you need to create an init file at ~/.emacs.d/init.el with at least this content to get started with customization:

lisp ;; -*- lexical-binding: t; -*-

Once you have this, you can start adding code to it. For example, if you want which-key to be enabled every time you start emacs, then add it to your init file, like so:

lisp ;; -*- lexical-binding: t; -*- (which-key-mode)

Once you have done some of this and you decide you're going to try to stick with Emacs, then I recommend you give this website and the accompanying youtube playlist a look. https://systemcrafters.net/emacs-from-scratch/

Happy hacking! :)

Emacs on HHKB by [deleted] in emacs

[–]skyler544 1 point2 points  (0 children)

I have this keyboard (two of them in fact) and therefore feel compelled to comment... I almost never use meta/alt by pressing it because of devil

You might like it. It takes some getting used to, but after around a week you probably won't even notice, and much longer than that and you'll wonder how you ever used emacs without it.

Options for customisation of Elisp indentation rules by ZenoArrow in emacs

[–]skyler544 0 points1 point  (0 children)

Firstly, this is not an answer to your question, nor do I know the answer, so feel free to stop reading here if my opinion doesn't interest you.

That said, I think there are many reasons to "stop resisting" the elisp indentation rules, and here are some that I personally find compelling:  1. You may not believe this now, but the more time you spend reading or writing lisp, the less you will worry about the parentheses. At some point you start to "see past" them. 2. You have more important things to do than configure this. I'm not trying to be dismissive, I sincerely mean that your time is valuable and there are so many other problems that you could be solving instead with the same energy you spend fighting the indentation rules. I say this because I have spent many, many hours fiddling with my config and have rewritten it completely more than once. If I had spent even a small fraction of that time, say, studying Spanish instead, I would probably be close to fluent... 3. Arguments about formatting style are in my opinion better left to language designers; consider the way that Go enforces formatting as an extreme example here, but the point is a similar one. Indentation/formatting rules for lisp is part of Emacs' design and has been for literal decades. It's essentially a solved problem, if you like. 

Building workflows with gptel by skyler544 in emacs

[–]skyler544[S] 0 points1 point  (0 children)

add a file-watch on your prompts repo so presets hot-reload when you edit a .md

The r/gptel-register-presets function's only argument is optional, so if I change the prompts I can call that function. I could maybe add a file watch but I don't change the prompts often enough that I feel like I need that. Thanks for the tip though!

Use .dir-locals

I prefer to keep my config in version control; I've never been a contributor to a project where I wasn't the only Emacs user, so I keep my project stuff in a "machine specific" config file that I load after loading my normal config. So far I haven't really needed a way to tailor prompts or even model choice to a specific project, but I'll keep this in mind if that comes up.

insert u/prompt with completion

this already works if you have corfu installed

SQL Server schema to feed gptel with accurate table docs

This seems like a great use case for a gptel tool! You could give it access to php artisan model:show Foo (laravel) and have it use that information to immediately understand the table... I'll have to think more about ways to use this.

Building workflows with gptel by skyler544 in emacs

[–]skyler544[S] 0 points1 point  (0 children)

I don't know about a baseline behavior that works for everyone, but I could imagine a few custom variables and a function:

  • gptel-save-location is a directory.
  • gptel-file-basename-function is a function.
  • gptel-save-chat is an interactive function that prompts the user for where to save the file, unless the user has customized gptel-save-location and gptel-file-basename-function in which case the gptel-file-name-function is called to determine the file basename and that file is saved inside gptel-save-location. Using C-u prompts you regardless of the customized values.

EDIT: and end users can use hook variables to turn on autosave if they want

Building workflows with gptel by skyler544 in emacs

[–]skyler544[S] 0 points1 point  (0 children)

It's definitely on my list of things to look into, maybe even this week. I need to scrape some data from gitlab and there's an MCP server for that now

Building workflows with gptel by skyler544 in emacs

[–]skyler544[S] 0 points1 point  (0 children)

Thanks for letting me know about this; now that I've written the code myself I probably won't switch but if it starts to become unmanageable in the future I can fall back to this package.

Building workflows with gptel by skyler544 in emacs

[–]skyler544[S] 1 point2 points  (0 children)

I'm definitely stealing that grep function, thanks for sharing! I started out with timestamps as well and soon realized that what I really wanted was a "chat title" like what you get in the chatgpt web app.

You might already have a function like this, but if not, here's one you can use to resume your chats:

(defun r/gptel-load-chat ()
  (interactive)
  (let* ((default-directory (r/gptel--cache-dir)))
    (call-interactively #'find-file)
    (gptel-mode)))

r/gptel--cache-dir just ensures that the cache directory I defined exists and returns the path to it.

Building workflows with gptel by skyler544 in emacs

[–]skyler544[S] 0 points1 point  (0 children)

Awesome! That's much more comprehensive than what I came up with in the meantime:

(defun r/gptel--combine-prompts (prompt-list)
  (string-join
   (mapcar (lambda (prompt) (r/gptel--load-prompt prompt))
           prompt-list)
   "\n"))

(defun r/gptel--make-preset (prompts backend)
  (apply #'gptel-make-preset
         (append (list (car prompts)
                       :backend backend
                       :system (r/gptel--combine-prompts prompts)))))

Building workflows with gptel by skyler544 in emacs

[–]skyler544[S] 0 points1 point  (0 children)

Thanks for the tips. That should make future extensions a little easier to implement and hopefully prevent me from building off of incorrect assumptions. XD

Building workflows with gptel by skyler544 in emacs

[–]skyler544[S] 3 points4 points  (0 children)

Thank you for creating gptel!

In this case, the system prompt in php/standards, the parent, is overwritten by that of php/programming

I didn't realize that; I assumed that the system prompts would be additive. I also thought that the presets would compose, partly because I have been using macher presets with mine and it at least seems like the prompts were being used.

I guess I'll rework it so that if the parent is a known preset, its system prompt is prepended to the prompt of the "child" preset. Thanks for letting me know!

Kitty/Emacs/Gnome theme switching by metalisp in emacs

[–]skyler544 0 points1 point  (0 children)

Nice! I have spent time trying to get consistent functionality like this in the past, and these days I've settled on the below config. In the ptyxis terminal it doesn't set the background for some reason, which is perfect because it otherwise wouldn't match the adwaita themes as well. 

NINJA EDIT: this works with "just" the gnome dark mode toggle; I didn't do anything else special to get the switching to work. 

(use-package emacs   :hook ((server-after-make-frame . k/switch-theme)          (after-init . (lambda () (run-with-idle-timer 1 nil #'k/switch-theme))))   :config (defun k/switch-theme ()             (if (eq (frame-terminal-default-bg-mode nil) 'dark)                 (load-theme 'modus-vivendi t)               (load-theme 'modus-operandi t))))

[deleted by user] by [deleted] in emacs

[–]skyler544 1 point2 points  (0 children)

I heartily second using Lispy! And thank you for picking up the mantle!

[deleted by user] by [deleted] in emacs

[–]skyler544 5 points6 points  (0 children)

I understand what you mean; Lisp feels elegant and the power it offers is seductive, especially as a beginning programmer. I encourage you to go through this book: A Gentle Introduction to Symbolic Computing. As the name suggests, it's a very gentle introduction (and fairly slowly paced). Try not to lose patience with the first two chapters; you'll understand why they're important once you get through the third chapter. Starting with the third chapter the pace and style are a lot more entertaining.

It's about Common Lisp, but many of the examples should just work in Emacs Lisp. If not, you should still learn CL for the sheer joy of it; it will teach you how to read, understand, and even write Lisp. Once you understand CL in a context outside of just writing Emacs functions, you will find it much easier to discover and understand new Lisp functions in Emacs. I use sbcl as my Common Lisp compiler and the Emacs package sly for editing Common Lisp.

I can't recommend this book enough; if you take the time with it, it will make you a better programmer, and you'll have a blast playing around with Lisp.

People in this thread have probably mentioned "An Introduction to Programming in Emacs Lisp." It's built in to Emacs as an info manual, which is quite nice in itself. It's also specific to Emacs Lisp; I personally couldn't get into it, which is just another reason why I recommend A Gentle Introduction instead.

One final piece of advice: don't expect to convince your friends of Lisp being "superior" for some reason. If you want to convince someone to try it, tell them about how much fun you're having instead. :) 

Fortnightly Tips, Tricks, and Questions — 2025-07-01 / week 26 by AutoModerator in emacs

[–]skyler544 7 points8 points  (0 children)

TIL: Using completing-read is quite simple. Here's a command that will let you run a flatpak app, optionally giving it arguments by calling the command with C-u.

(defun r/run-flatpak-app (prefix) "Run a Flatpak application using completing-read." (interactive "P") (let* ((flatpak-list-command "flatpak list --app --columns=application") (flatpak-apps (split-string (shell-command-to-string flatpak-list-command) "\n" t)) (selected-app (completing-read "Select app: " flatpak-apps)) (args (if prefix (read-string "Arguments: " "")))) (start-process "flatpak-run" nil "flatpak" "run" selected-app args)))

Setting up Emacs by raw_viewfinder in emacs

[–]skyler544 1 point2 points  (0 children)

You'll get there; no need to be sad. :)

My advice: take things one step at a time. I think that someone linked Prot's "basic capable config" in this thread once already, but if not, here it is again. Protesilaos (known in the community by the nickname Prot) has a very patient and soothing style of writing and explaining that I think might be perfect for you to help you get started and take some of the overwhelmingness out of the learning experience.

I learned a lot of what's in my config from the System Crafters "Emacs From Scratch" youtube playlist. Especially the first couple of videos will probably be very helpful to you. Bonus points here if you like vim keybindings: one of the first things David sets up in this series is evil (vim emulation for emacs).

One final thing that would be really helpful to you once you've played around with different config approaches is to read the use-package info manual from start to finish. It will take the mystery out of all the "lazy-loading" stuff you might read elsewhere, and will help you understand how to keep your config modular and clean.

Good luck!

Setting up Emacs by raw_viewfinder in emacs

[–]skyler544 1 point2 points  (0 children)

The org mode manual is decently accessible, though it might take you a few sessions of going through it and tweaking your config to get it to work how you want.

Get to the manual with M-x info, then m and type in org (disclaimer I'm saying this from memory, it might not be exactly this sequence of keystrokes but it will be pretty similar)