#emacslisp

2025-05-19

[Перевод] Jupyter-Ascending — новый способ работы с Jupyter Ноутбуками в Emacs

Вы обожаете Emacs, но вам необходимо работать с Jupyter ноутбуками? Данная статья расскажет еще об одном способе, как их подружить. Заходите под кат =)

habr.com/ru/articles/910812/

#jupyter #emacs #emacs_python #emacslisp #перевод

2025-05-13

What brought you to #Emacs?

@myTerminal I was using Tmux, Vim, Bash, AWK, and FZF, and I kept trying to write scripts for all of these programs that would allow me more coordination between them. For example, I once wanted to launch a process from Vim in a second terminal in a Tmux split-screen, capture it’s output into a temporary file, then when the process exited, use AWK to select symbols from the file that I could later feed into FZF. Or I would write a little wrapper Bash script that would run a build process and send a notification and trigger Tmux to automatically switch to the shell when the process completed.

I was always thinking to myself how I wished all of these separate tools, which were all doing one just thing and doing it well (the Unix philosophy), could be connected together without needing to use pipes or complicated message passing through temporary files or through DBus. And I also wished they were all written in the same programming language, instead of having a different language for Bash, AWK, VimScript, and the config languages for Tmux, or using long chains of CLI options stored into partial script files.

Then it hit me one day that this thing that I was wishing for, which coordinated between the terminal multiplexer, command shell, editor, and auto-completion framework and was all scripted with just one programming language, this thing already existed and it was called Emacs.

Then I finally understood what all the fuss was about, and switched to Emacs forever.

#tech #software #lisp #Emacs #EmacsLisp #UnixPhilosophy #FreeSoftware #FLOSS #FOSS #CLI #CommandLine

2025-05-08
Progress on my clone of the Emacs Lisp interpreter

This took me three months (a month longer than I had hoped), but I finally have merged it into the main branch!

This patch rewrites the Emacs Lisp lexer and parser in Scheme using Scheme code that is 100% compliant with the #R7RS standard, so it should now work across all compliant Scheme implementations. Previously the old parser relied on #Guile -specific regular expressions.

This patch also implements a new feature where a stack trace is printed when an error occurs. This of course makes debugging much, much easier. Previously the old parser did not keep track of where code evaluation was happening, it simply produced lists without source location information. The new parser constructs an abstract syntax tree (AST) and source locations are attached to the branches of the tree which can be used in error reporting and stack traces.

Next I will make whatever minor tweaks might be necessary to get my Emacs Lisp interpreter run on other Scheme implementations, in particular MIT Scheme, Gambit, Stklos, and Gauche. I would also like to try to get it running on Chicken and Chez, although these are going to be a bit more tricky.

Then I will continue with the task of implementing a new declarative GUI library.

#tech #software #FOSS #FunctionalProgramming #Lisp #Scheme #SchemeLang #EmacsLisp #Emacs #Schemacs #GuileScheme

James Endres Howelljameshowell@fosstodon.org
2025-05-01

TURNS OUT that if you look carefully at the debugger in the *Backtrace* buffer after you make a mistake in Emacs lisp, it TURNS OUT that you can find your dumb mistake where you used the wrong goddam type

#emacs #elisp #emacslisp

The ol' tealeg 🐡tealeg@mastodon.online
2025-04-30

@me I guess you could fairly easily write a macro that automatically created a lexical scope and added some prefixes to variable used within its body - Doug Hoyte's "Let over lambda" book has #CommonLisp examples of this kind of approach as way to cut down the syntactic overhead of using gensym in macros. Without much thought, I'd assume something similar could be done in #EmacsLisp

2025-04-25

As a sort of codicil to my last "Wall Clock" video, here is one where I demonstrate how to fix two small bugs in the code as it exists on Ramin Honary's github repository:

youtube.com/watch?v=qYq-mskrKS

#emacs #emacslisp

2025-04-23

""You don't have to like Emacs to like it" - this seemingly paradoxical statement is the secret of GNU Emacs. The plain, 'out of the box' Emacs is a generic tool. Most people who use it, customize it to suit themselves."

— Robert J. Chassell: Emacs Lisp - An Introduction, p. 185

Ok, I've read all chapters, but I'm not setting this book as read until I finish some exercises (and read appendixes). I'm especially interested in the plain text graphs library since I enjoy data visualization whenever I can work on it.

Another note to myself. I've used yank-pop first time today. I knew of kill-ring but never bothered to delve deeper since no other software I'm using implements it in a way to store more elements on the clipboard.

And I have my eyes on the next goals as well: The Emacs Lisp Elements by Protesilaos Stavrou. I'll try to read it on my e-ink screen, because I'm not utilizing it enough (it would be so nice to have touch screen gestures to scroll working on my #debian with #i3).

And after that, I'll check if there are any simple packages that need co-mainteners. #EmacsLisp

Robert J. Chassell: Emacs Lisp - An Introduction (Paperback, Samurai Media Limited)
2025-04-17

I'm loving the gentleness of introduction that this book provides. It goes slowly through the code examples and shows you how to read the #EmacsLisp code.

And a spoiler: Here is my attempt for the Chapter 8 exercise: (defun test-search (string) "Search for string and left a point there if it is found." (interactive "sSearch for: ") (let ((found) (current (point)) (len (length string))) (save-excursion (while (and (< (+ len current) (point-max)) (not found)) ;; why complicate? just whole string on each position. (if (string-equal string (buffer-substring-no-properties (point) (+ (point) len))) ;; we found the string (progn (message "Found!") (setq found t) ) (progn ;; else (setq current (+ 1 current)) (forward-char) ) ) ) ) (when found ;; we found the string so we move the point. (goto-char (+ current len)) ) ) )

(comment on Emacs Lisp - An Introduction)

Robert J. Chassell: Emacs Lisp - An Introduction (Paperback, Samurai Media Limited)
Alfred M. Szmidtamszmidt
2025-04-17

Anyone wanna write a small mode that handles fontified files?

N-gated Hacker Newsngate
2025-04-12

🔥 Behold, the divine opus on Emacs Lisp Elements by , the of All Things Unrelated to Actual Programming. 🌟 For the low, low price of your sanity, immerse yourself in a stable version time travel tale set in 2025. 📅 Because why wouldn't you want private lessons on "Life" from someone named after an ancient Greek hero? 🤔
protesilaos.com/emacs/emacs-li

Karsten Johanssonksaj@infosec.exchange
2025-03-30

Some important acronyms to know. Feel free to add some of your own.

Lisp:
Logic In Symbolic Paradigms
Lisp Inspires Strange People
Lisp Is Secretly Perfect

Python:
Pseudocode You’d Teach Hordes Of Newbies
Probably You'll Try Harder On Next-lang
Python: You'd Think Hardware's Optional Now

Emacs:
Editor Maintained As Community Shrine
Ecosystem Mainly Acquired by Cult Sysadmins
Emacs Means Always Configuring Something

Vim:
Vaguely Interactive Misery
Very Irritating Macros
Vim Isn't Modern

Linux:
Legendary Interface, Notoriously Unforgiving eXperience
Loyal In Nature, Unmatched eXtensibility
Linux Is Natural Under X

#emacs #vim #linux #python #lisp #commonlisp #clojure #emacslisp #elisp #sbcl #julia #racket #wordplay #developers #programming

2025-03-15

I’m an amateur lisper, mostly #Guile and #EmacsLisp, but if someone wants to team up for this #GameJam, I’d be interested!

I also do some basic art, game design, sound, and music. I wouldn’t want to be the sole programmer for this jam but could definitely contribute there and would love to learn more #Lisp.

https://toot.cat/@dthompson/114166799349052427

2025-03-12

I am once again faced with the bleak irony of people who like to code in the terminal with Vim or Nano, but also install onto their computer some 5 or 10 apps via FlatPak or Docker, including VSCode, each installed with their own entire copies of Node.js and Electron.js (differing only in their minor revision number), while also complaining about Emacs being “bloated” because it ships with a miniature web browser and fully-featured e-mail client.

#tech #software #Emacs #WebBrowser #WebDev #WebApp #SoftwareDevelopment #FunctionalProgramming #Lisp #EmacsLisp #FOSS #FLOSS #FreeSoftware #FlatPak #Docker #AppStore #ElectronJS #NodeJS

N-gated Hacker Newsngate
2025-03-07

🧐 So, aspiring Emacs Lisp wizards, you've dreamt of a utopia where you can puzzle over one.el for days just to avoid using WordPress? 🧙‍♂️✨ Because nothing screams "user-friendly" like cramming HTML and CSS into your favorite text editor and calling it a site generator. 😂 Good luck explaining this to your non-Emacs friends!
one.tonyaldon.com/

Hacker Newsh4ckernews
2025-03-07
Andrew Arensburgerarensb@ooblick.com
2025-02-03

Location-Based Themes in Emacs

There are lots of Emacs themes out there. People mostly use them to change colors. That’s great, but you can do more. As the documentation says:

Custom themes are collections of settings that can be enabled or disabled as a unit.

That can be any setting, not just colors.

I use Emacs in multiple situations. I use it at home, I use it in the office, I use it when I’m working from home, and so on. And there are settings that change depending on how and where I’m using Emacs, the most obvious of which being user-mail-address, which I want to set to user@home.org when I’m sending personal mail from home, and user@work.com when I’m sending professional mail from work. I have other settings that change between locations, like the directory where org files go, because reasons. Your location-dependent settings will be different.

So it seems the natural way to deal with this is to put all of the location-dependent settings in a theme, and load whichever theme is appropriate for what you’re doing. Since themes are groups of settings that can be turned on or off as a group, you can even switch themes in the middle of an Emacs session. For instance, if you’re a consultant working with two clients, you can enable theme client1 in the morning; and then, in the afternoon, disable theme client1 and enable theme client2 to update your settings.

Setting Up Location-Based Themes

To start with, let’s set up a couple of themes called personal and work, for personal and professional stuff, respectively. Check the value of custom-theme-directory. By default, Emacs looks for themes in the same directory as init.el, but I like to put them in a separate subdirectory, ~/.emacs.d/themes. Customize this to your taste. For the rest of this post, I’ll assume that you’re using ~/.emacs.d/themes.

Theme files should go in a file named <theme-name>-theme.el. So create the file ~/.emacs.d/themes/personal-theme.el to hold the personal theme:

(deftheme personal  "Settings when working on personal projects."  :family "location")(custom-theme-set-variables 'personal '(user-mail-address "bob@home.org") ;; Add additional variables here. )(provide-theme 'loc-personal)

You can now run M-x load-theme personal to load the theme. Theme files contain Emacs Lisp code, which can be a security risk, so the first time you load it, or any time you make any changes, Emacs will ask you to confirm whether to load the theme, and whether to mark it as safe in the future. If you say yes, the next time it’ll just load the theme asking for confirmation.

Follow the same steps to create a work theme.

Loading A Theme at Startup

Once you have something that works reasonably well, you’ll probably want something that loads the right theme when Emacs starts. For this example, we’ll assume that if the hostname is my-laptop, then you’re working on personal things and want to load the personal theme, while if the hostname is office-workstation, then you’re at work and want to load the work theme.

Add something like the following to your ~/.emacs.d/init.el:

(add-hook 'emacs-startup-hook  (lambda nil    ;; Figure out which theme to load, depending on which machine this    ;; is running on, and which options were specified.    (let ((loc-theme 'unknon)          )      (cond       ;; Running on personal laptop.       ((string= system-name "my-laptop")        (setq loc-theme 'personal)        )       ;; Running on work machine.       ((string= system-name "office-workstation")        (setq loc-theme 'work))       ;; Add any other locations/work modes here.       ))      ;; Check whether the theme exists. If it does, load it.      (if (member loc-theme (custom-available-themes))          (progn            (load-theme loc-theme)            )        (warn "Can't find location theme \"%s\"" loc-theme)        ))))

Here, we’re just looking at the hostname, but obviously the condition can be arbitrarily complex. You might pick different themes depending on the day of the week, or whether you’re ssh-ed in from another host, the phase of the moon, or whatever makes sense in your situation. Add or remove themes as necessary.

Further Thoughts

One advantage of doing things this way is separation of information. Maybe you want to make your Emacs setup publicly visible on github, but your work setup includes hostnames or other information that shouldn’t leave company premises. In this case, you can store your work-theme.el file on your company machine, perhaps in a separate directory. You can add an entry to custom-theme-load-path, a directory outside of ~/.emacs.d, so that your work theme doesn’t accidentally get added to the git repo that has your init.el and your publicly-visible themes.

There’s one problem that I haven’t found a good solution to: child themes. Let’s say you have your work theme, with a hundred work-related settings. But of those 100 settings, there are three that change depending on whether you’re logged in to host1 or host2.It would be nice to have a host1 theme that automatically includes everything from the work theme, plus the three settings that are specific to host1. I don’t see a good way of doing this. It might make sense to use literate programming to generate multiple *-theme.el files from one source .org file.

#emacs #emacsLisp #literateProgramming

2025-01-23

This idea of “glueing” together utilities via elisp for me is at the core of what makes #Emacs attractive for knowledge workers. All of my projects draw on command line tools (rg, fd, wget, mpv etc) to process information of various kinds. As someone with no formal background in programming, I found elisp easier (and more useful) than bash and way more stable & reliable than Python (dependency hell).

From: https://mastodon.social/@laotang/113876608683711304

@laotang Absolutely. This is a big reason why I switched to Emacs. I used to subscribe to the “Unix philosophy” of every tool does one thing and one thing well, and Emacs seemed like the opposite of that. But I started to realize that I was hacking together a bunch of disparate tools with Unix pipes, tools like Vim, Tmux, Bash, Sed, Grep, my window manager, my file manager… and none of these tools spoke the same language so it was incredibly difficult to get them to all to work together with just Unix pipes.

When I realized that Emacs is not a tool but an app platform and a programming language, I realized that Emacs actually follows the Unix philosophy even better than Unix itself does. In Emacs, every “Mode” (Major Mode, or Minor Mode) is a tool that does one thing and does it well, and you compose tools together with text buffers rather than with pipes. And Emacs Lisp, as old as it is, is a much, much better programming language than Bash.

I wrote my own blog post about it not too long ago.

@xenodium

#tech #software #Emacs #Lisp #EmacsLisp #FOSS #FLOSS #FreeSoftware

2025-01-23
A platform that moulds to your needs

A blog post by @xenodium . Here is an excerpt:

As you become more accustomed to Emacs, you may find yourself wishing you could navigate other tasks just as efficiently. But this doesn’t happen right away. The editor starts moulding to your needs, initially as you copy others’s code/configurations, but this can only take you so far. Emacs truly does mould to your own needs, once you start learning a little elisp.

When comparing elisp to modern languages, one may be tempted to dismiss it as a niche language from another era. While both of those things may be true, its moulding and glueing capabilities remain just as relevant and powerful today, even in the LLM era.

#tech #software #Emacs #FreeSoftware #EmacsLisp #Lisp #FLOSS #FOSS

Divya Ranjan :hilbert:divyaranjan@mathstodon.xyz
2025-01-18

I was tired of having to rely on a browser for fetching torrents from torrents-csv.com so I sat down for a few hours and put together an Emacs front-end for it. It is very minimal and all it does is get the magnet for a selected torrent, but it's one step away from the browser :)

Soon I'll also add the functionality to have a magnet appended to download within Emacs, using Stefan Kangas' mentor package.

I eventually want to have a general torrent search engine inside Emacs but for that I need a better way than relying on fishy crawlers, I'd probably self-host bitmagnet.io. But that'll be in the future.

codeberg.org/divyaranjan/torre

#GNUEmacs #EmacsLisp #Lisp #Torrenting

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst