#emacs lisp
Explore tagged Tumblr posts
monaddecepticon · 6 months ago
Text
Oh yeah. Elisp without lexical binding and cl-lib is torture.
For those of you following my "emacs on android" exploits
I was playing the Owlcat 40k Rogue Trader game (I don't think the following will spoil anything but you know, read on on your own risk) when presented with the following message while using a cogitator:
Tumblr media
I was sure that this was encoding an item I need so I took a photo and used google lens to copy the text (I always try tesseract cli first but it never produced a correct result so far)
I tried to paste it to an online tool but it expected the numbers to be partitioned in eights so I guessed might as well write the whole thing in elisp:
Tumblr media
Well as they say technically correct is the best kind of correct. Some "#b%s" indeed. I don't know what I expected.
But using #'read is always fun and I did manage to solve it so I had a good time...
13 notes · View notes
guix-official · 11 months ago
Text
Tumblr media
29 notes · View notes
mirqmarq428 · 1 year ago
Text
How do we directory in common lisp? Missing f.el rn
3 notes · View notes
Text
A few months ago I wrote this little macro for Emacs lisp called `lambda-let`, and I rather enjoy having it around.
It expands to a mere `lambda` wrapped in an `apply-partially`, but you get all the syntax niceties of a `let` form. You can get most of the idea by just comparing the "signatures":
(let VARLIST BODY...) (lambda ARGS BODY...) (lambda-let VARLIST ARGS BODY...)
(I actively oppose abbreviation in names by default, but these are the canonical names Emacs uses.)
So basically you get both a `let`-style variable list and a function argument list. For example, if you want to write a lambda that takes two parameters `foo` and `bar` but also lexically closes over `qux` in outer scope, you'd do:
(lambda-let (qux) (foo bar) ...)
which expands to
(apply-partially (lambda (qux foo bar) ...) qux)
But that's boring. Useful, ergonomic, but boring. Here's a more fun use:
(lambda-let ((qux (some-function-or-whatever)) (alp (do-stuff thing1 thing2))) (foo bar) ...)
which expands to
(apply-partially (lambda (qux alp foo bar) ...) (some-function-or-whatever) (do-stuff thing1 thing2))
Like I said:
you get all the syntax niceties of a `let`
The only difference from `let` is that `qux` and `(qux)` forms in the varlist are shorthands for `(qux qux)`, not `(qux nil)`, since the latter would be mostly useless while the former is one of the main use-cases - maybe even the most common one.
There's probably other ways to do this already in the libraries that ship with Emacs (especially in the Common Lisp stuff), but I remember taking a quick glance and for some reason not liking what I saw - not necessarily for any good reason though, I don't remember. In the meantime, I am happy with this! I find it very intuitive and pleasant to use!
This also lets us get lexical scope on a per-lambda basis, which helps if you've got code written for Emacs' default of dynamic scope and want to just have something that works without turning on lexical scope for the whole file and dealing with any breakages from that.
2 notes · View notes
randointernetperson · 2 months ago
Text
Like I don't think I have any… I have been using scrips to do it automatically for years now, but what if… juuuust like what if there is like some paper some where form like 3 third grade where I was a lazy little foul…
Also sometimes I write lisp code soooooooooooo...
) <- super parenthesis. reblog to close all parentheticals you opened and forgot to close in your life and return to equilibrium
71K notes · View notes
cups-official · 3 months ago
Text
my main motivating factor for learning new programming languages is how funny I think it would be
0 notes
patchoulii-2hu-144p · 1 year ago
Text
decided to learn common lisp, seems very different from everything else.
0 notes
bisexual-engineer-guy · 21 days ago
Text
The lisp experience.
* (Oh, these parentheses I keep opening?
* (I'm collecting them.
* (Right now, I'm 1,762 parentheses deep.
* (Oh, my precious parentheses... (I don't ever want to close them!
38K notes · View notes
piratesexmachine420 · 1 year ago
Text
Every piece of software should just be a lisp interpreter in disguise I think
1 note · View note
laejoh · 2 years ago
Text
Use GNU Emacs - The Plain Text Computing Environment
Use GNU Emacs - The Plain Text Computing Environment (With a number of lovely quotes at the beginning:
Using Emacs is kind of like making a piece of art. You start with a big block and you slowly chip away, bringing it closer and closer to what you want. —Mary Rose Cook
[Emacs is] a Lisp Machine with several compatible user interface modalities. Which is just amazingly helpful to [blind] people like me […] who are typically forgotten about these days. […] Emacs is a shining beacon in a dark age of canvases and decorative user interface design. —Mario Lang
It wouldn’t make sense to start out with anything other than Emacs. I don’t think there has been a piece of software which has had a larger impact on my life. I began using this about fifteen years ago, and it has followed me across operating systems, jobs, roles (I used it to manage my teams), languages, and needs. Every time I start something new, Emacs has been there to make it just a little easier, and the more I do in it, the easier everything gets. I believe this power comes from Emacs being the closest thing we have to a working Lisp Machine. —Katherine Cox-Buday
Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish. —Neal Stephenson
Emacs is the King of Editors because it’s a Lisp interpreter. Each and every key you tap runs some Emacs Lisp code snippet, and since Emacs Lisp is an interpreted language, that means that you can configure any key to run any arbitrary code. You just, like, do it. —Lars Magne Ingebrigtsen
I’m using Linux. A library that Emacs uses to communicate with Intel hardware. —Erwin, #emacs, Freenode
OSs and GUIs come and go, only Emacs has lasting power. —Per Abrahamsen
I am large, I contain multitudes. —Walt Whitman) (🔁) (mapcar #'emacsomancer objs) (@[email protected]) 2023-03-03 09:57:02
1 note · View note
mirqmarq428 · 1 year ago
Text
You have heard that it was said: "Emacs is a good operating system, lacking only a decent editor". But amen amen I say to you,
It's basically notepad. You are intimidated by programmable notepad.
1 note · View note
mentalisttraceur-software · 2 years ago
Text
Today I wrote a doubly-linked list variation (in Lisp) with a data layout which can allows accessing the data as a singly-linked list (the norm in Lisp).
Forced upon me because so much of Emacs is written to only handle a handful of specific iterable data-structures.
In modern languages, where "modern" starts over a decade ago, iteration can be overloaded - most things are written to take any iterable, and any object which implements a little basic magic can do it.
But in Emacs, it's still normal to just have functions which handle only lists or a small hard-coded set of sequence types. So this is a very efficient workaround for that limitation.
I already wrote an explanation that I'm really happy with in the commit message, so you can read more over there.
This is pretty nice to have in my toolbox in itself, but it was in service of building an ordered hash table/map whose elements can also be accessed as a normal Lisp list from most recently inserted to oldest.
So now I can have things in doubly-linked lists and hash tables, and still pass them to any function which operates on a regular list without mutating it, basically for free.
5 notes · View notes
linux-opinions · 19 days ago
Note
"Linux users love to argue arcane semantics" swear to god for a second I thought that was a joke about the league of legends show.
Can you at least share your superior editor preference, or point me in the direction where I might find it?
real talk? vim and emacs both have a prohibitively excessive learning curve and are to text editing as gentoo is to distros: fascinating, cool, and people can do some amazing things with it, but expecting most people to get on board is a waste of energy.
personally i don't have just one editor. i use micro for basic/light edits (i like micro a lot. its simple but does a little more out of the box than nano and its config feels sane to me), zed for coding (this is NOT an endorsement, zed keeps Pissing Me Off, I just don't want to go back to vscodium), and im proficient enough in nano and basic vim to do what I need to on a system where I don't have micro.
im currently writing my own markdown/wiki/zettlekasten note editor to replace obsidian for my fiction writing, and for work im forced to use whatever Microsoft trash is on my locked down HP elitebook 🤡, but none of that is very intensive or technical.
all that said - im not a huge fan of my current situation, especially in regards to coding.
im stuck between wanting to play with the big kids (using emacs/vim and having a Cool and also Tricked Out config), not wanting to learn the default keybinds (im not deluded enough to think that i, a certified fucking clown, would be any faster/better at editing with them) and not wanting to learn lisp/lua/vimscript enough to bend the keybinds into a shape I feel I can actually understand (lisp in particular makes less than 0 sense to me because it's so different from typical languages im used to).
12 notes · View notes
mogwaipoet · 3 months ago
Text
When I tried using Emacs, I asked the Emacs newsgroup how to disable auto code formatting
The replies unanimously agreed that I should look more closely at the formatting settings because they cover every possible style preference.
If I'd explained that no, the settings don't cover my brace style, the conversation would instead become me trying to justify why I'm using such a weird style, so instead of trying to engage with the Emacs community further I learned enough Emacs Lisp to fix it myself.
Anyway, my point is that one of the biggest benefits of learning how to program is being able to avoid talking to programmers.
17 notes · View notes
ceausescue · 7 months ago
Text
decided to properly knuckle down and learn emacs lisp. im beginning to think this language might not be very good
14 notes · View notes
liquidcrystalsky · 11 days ago
Note
if you dont have windows. whats that button on your keyboard
its the "super" key! its the generic name for the windows/command(macos) key, and the way its used depends on your desktop environment or however you set it up.
For something like Cinnamon or Plasma, it opens an application launcher like how it does on windows. theres also various key combinations involving it which open apps or perform certain actions basically exactly how windows does.
I use a tiling window manager, i have super+space set to an application launcher, and i use the rest to control my windows. Super+H/J/K/L is focus up left/down/up/right, and doing that and holding shift moves a window around. Super+Q is close a window, Super+F to change to floating, Super+S to fullscreen, its so i can control my desktop using only the keyboard basically.
the super key was made to be in a set of 3 modifier keys (Super, Meta, Hyper) like Ctrl or Shift, it was made for old Lisp machines but the keyboards which had these keys got use in Linux and BSD as well.
Windows added the Windows key, and for a while the windows key was used as the Meta key on linux, but eventually it was moved to Super (though Plasma still incorrectly calls it Meta) and it morphed into basically just the windows button by default
but even with a windows-like DE like Plasma you can just change it to do whatever you want it to. i know the ppl who use Emacs probably do insane shit with it probably
5 notes · View notes