
u/jcubic

What is the best way to influence the next buffer after kill?
Is there a way to make Emacs prefer showing buffers with the same major mode when I kill a buffer instead of random buffers (or whatever order it uses)?
I just bricked my session (loaded "package.el" from the next version of Emacs), and I wanted to kill all Agent-Shell sessions one by one, and write a prompt to save what it has in the context into SESSION.md file.
And after a few kills (I have about 10 agent-shell buffers that I toggle in one window), it changed to something totally random (a yaml file).
I want to have all major modes one by one when I'm killing buffers.
I asked Grok, but the code didn't look very nice. There should be some clean way to do this.
What is the best way to add this to Emacs?
It would be nice if you could just sort (group by) the history kill buffer is using, by major mode.
I have a weird issue. I'm using Fedora, and I had this in my bash config:
alias ls='ls -h --color=auto'
...
if [ -x "$(command -v eza)" ]; then
alias ls='eza';
elif [ -z "$(command -v exa)" ]; then
alias ls='exa';
fi
It was working like this for a long time. -z should enable alias to exa that is not installed. But it was working.
I just cloned the Git repo and used:
corepack enable
And suddenly, ls gives an error that exa is not installed.
For unknown reasons, in different shells, ls is an alias to:
$ alias ls
alias ls='ls --color=auto'
~/.bashrc loads /etc/bashrc and but I don't see any such alias. The same in ~/.bash_profile and /etc/profile.
Nothing was changed in my configs, because when I start a new shell, ls is still ls --color auto.
I can just fix the exa issue in my config and call it a day. But I really want to find out what is happening here.
Any ideas what else I can check?
I've created a library that renders ASCII Globe. It's written in JavaScript. It works in Browser and Node.js (terminal). You can style with ANSI escape codes (terminal) or HTML+CSS in the browser.
https://github.com/jcubic/ascii-globe
You can change the size of the globe, characters, style, add margins.
The pins have real GEO location, and each of them can be styled differently.
I hope you like this. Feedback appreciated.
I'm a programmer, and I use AI a lot to write code. Recently I've started using Agent-Shell and decided to use it to write Emacs Lisp code.
Above is a function created by Opus 4.6 inside Agent-Shell.
He found my code to cycle through buffers with the same major mode (that I map to C-M-tab and C-tab). And he created this code based on my description of what I want. Even indentation was correct.
The function switches to buffer with the same major mode, and when I press enter without picking anything, it switches to all buffers.
I also used the agent to help me with the permission system for Agent-Shell, similar to the one in Claude Code or Open Code.
Do you also use AI to help you write Emacs Lisp code and help with Emacs configuration? What is your experience?
I've extracted most of my ~/.emacs config into different files and put them into my dotfiles repository:
https://github.com/jcubic/dotfiles
Do you also share your Emacs config?