/emg/ - Emacs & Lisp General

Imponderable edition

>General Emacs resources
gnu.org/software/emacs/manual/emacs.html (GNU Emacs Manual)
emacswiki.org (Emacs Wiki)
github.com/emacs-tw/awesome-emacs (Big list of packages)
github.com/thinkhuman/writingwithemacs (Tips for prose writing in Emacs)

>Tutorials
C-h t (Interactive Tutorial)
gnu.org/software/emacs/tour (GNU Emacs Tour)
youtube.com/playlist?list=PLX2044Ew-UVVv31a0-Qn3dA6Sd_-NyA1n (General Introduction)
youtube.com/playlist?list=PLVtKhBrRV_ZkPnBtt_TD1Cs9PJlU0IIdE (Org Mode)
youtube.com/playlist?list=PL8Bwba5vnQK14z96Gil86pLMDO2GnOhQ6 (Advanced Configuration)

>(Self) Documentation
C-h k (Keybinds)
C-h o (Functions and Variables)
C-h i (Assorted Manuals)

>Premade Configs
=Make your own=
github.com/hlissner/doom-emacs/tree/develop (Doom Emacs)
github.com/syl20bnr/spacemacs (Spacemacs (heavy))
github.com/snackon/Witchmacs (Witchmacs)

>Reduce Startup Time
use-package defer
pastebin.com/mrPsnUas (Disable GC during startup)
emacswiki.org/emacs/EmacsAsDaemon (Emacs as Daemon)
akrl.sdf.org/gccemacs.html (Native Compilation, stable, merged into Emacs 28)
emacswiki.org/emacs/SetupEl

>Changing Default Keybinds
pastebin.com/2hg4g3C6

>Programming resources for Emacs Lisp, Common Lisp, Scheme and Clojure:
pastebin.com/nyTQp7qi

>Troubleshooting
If there seems to be a bug (or complicated issue), anons may ask you to compose an MWE (minimum working example).
To create an MWE, try the following:
1) start emacs with "emacs -q". This disables your init.
2) try to reproduce your issue with as few settings changed and packages (manually) loaded as possible.
These steps ensure that other anons can replicate your problem if it's something more involved. Sometimes you even find the cause yourself this way, too!

Previous thread:

Attached: pondering-emacs.png (1244x750, 1.51M)

Other urls found in this thread:

gnu.org/software/emacs/manual/html_node/emacs/Text.html
github.com/thinkhuman/writingwithemacs)
scheme.com/tspl4/
htdp.org/
github.com/ranger/ranger
ranger.github.io/
youtube.com/watch?v=AXJ9tTVGDwU
docs.racket-lang.org/gui-easy/index.html
erichgrunewald.com/posts/how-bad-is-qwerty-really-a-review-of-the-literature-such-as-it-is/
xahlee.info/emacs/emacs/emacs.html
gnu.org/software/emacs/manual/html_node/emacs/Backup.html
gnu.org/software/emacs/manual/pdf/eintr.pdf
emacswiki.org/emacs/WindowResize
reference.wolfram.com/language/ref/Subsequences.html
clhs.lisp.se/Body/f_subseq.htm
reference.wolfram.com/language/ref/Part.html
cliki.net/GUI
github.com/water111/jak-project
github.com/hlissner/doom-emacs
git.savannah.gnu.org/cgit/emms.git/tree/emms-player-mpv.el?h=9#n149
twitter.com/SFWRedditGifs

I just got back into emacs on gentoo
to EVIL users: why? Why use emacs if you actually want vim?

Why's MELPA so full of dodgy Chinese packages lately bros?

Attached: become-unvaxxable-1c12985d5e.jpg (800x630, 582.79K)

Emacs with EVIL was (and still is) a better Vim than Vim.

Attached: logo.png (180x71, 2.1K)

It still seems rather wasteful. Gimped vim runnig over an emacs you never learned how to use, whats the point?

is it really worth getting into Emacs if I don't code beyond the occasional shell script of a dozen lines or so? Most of what I type is just general English text and such.

I like it but it's really just taste at that point. No need to swap if you're comfy in vim, unless you'd like to try it out or smth

>It still seems rather wasteful.
How so?
>an emacs you never learned how to use
I can work my way around vanilla emacs, but I obviously prefer vim-style keybindings for navigation and editing.

like what?

If I actually want vim, I'll get vim.

Attached: evilp-nil.png (395x392, 112.16K)

Scheme!
Vim keybind is good.
Emacs is a general purpose text editor. Org-mode is useful even if you don't code at all.

Attached: 1641925085381.png (939x970, 404.79K)

Emacs has a lot of commands, modes, and packages for writing human languages
gnu.org/software/emacs/manual/html_node/emacs/Text.html

Evil is hands down the vim emulation on any editor i have used.

*the best

*THE vim emulation

i gave up on cooding a while ago but i still use emacs a shit ton. it's god tier for markup/prose/plaintext

Dunno about prose (I heard there are unironically actual writers using emacs instead of specialized software, see github.com/thinkhuman/writingwithemacs) but org-mode is the reason why many people use emacs at all. It's pretty retarded tbqh. They go for too much wikification imo.
t. uses emacs for both coding and note taking

It's not gimped. It's decent from my perspective as a long time vim user.

Why can't I map over cons-cells in Racket?
Is this normal behavior? It's complicating my program so much that I wonder if I should even use cons cells.

Attached: 1640111213047.gif (540x487, 308.33K)

Why would you?
Just use car, cdr???

Show us some code.

>I heard there are unironically actual writers using emacs instead of specialized software
does specialized software for authors even exist?
>org-mode is the reason why many people use emacs at all. It's pretty retarded tbqh. They go for too much wikification imo.
not really, the whole point of org is that it's as complex as you need it to be

(car '(1 . 2))
1

(cdr '(1 . 2))
2

(mapcar (lambda (e) e) '(1 . 2))
;; Debugger entered--Lisp error: (wrong-type-argument listp 2)
;; mapcar((closure (t) (e) e) (1 . 2))
;; (progn (mapcar #'(lambda (e) e) '(1 . 2)))
;; eval((progn (mapcar #'(lambda (e) e) '(1 . 2))) t)
;; elisp--eval-last-sexp(t)
;; eval-last-sexp(t)
;; eval-print-last-sexp(nil)
;; funcall-interactively(eval-print-last-sexp nil)
;; call-interactively(eval-print-last-sexp nil nil)
;; command-execute(eval-print-last-sexp)

(mapcar
(lambda (e) (car e)) '((1 . 2)
(3 . 4)
(5 . 6)))
(1 3 5)

just put the cons cell in a list?

It works better than vim in most cases.
I would say it is on par, if not better than vim's handling of these keybinds.

>emacs you never learned how to use
Learning the default keys is irrelevant.
Knowing how to use emacs is knowing how to remap them to something you like.

could not realy be much simpler

(defun mapcons (fun cell)
(cons
(funcall fun (car cell))
(funcall fun (cdr cell))))
mapcons

(mapcons (lambda (e) (+ e 1)) '(1 . 2))
(2 . 3)

Just use do loop.

(mapcar (lambda (e) (mapcons (lambda (e) (+ e 1)) e))
'((1 . 2)
(3 . 4)
(5 . 6)
(7 . 8)
(9 . 10)))
((2 . 3) (4 . 5) (6 . 7) (8 . 9) (10 . 11))

>(cdr '(a . b)) -> b (not a list)
>(car (cdr '(a . b))) -> error, b is not a list
>mapCAR
That's why lol.

Welcome to Racket v8.3 [cs].
> mapcar
mapcar: undefined;
cannot reference an identifier before its definition
in module: top-level
context...:
body of top-level
/gnu/store/nivzasmjdp2pgh93hj7wvwrlmwkasljh-racket-minimal-8.3/share/racket/collects/racket/repl.rkt:11:26

the function names differ in different lisps
mapcar is used in emacs lisp

but the same idea applies

Also if you're interested in iterating over an alist
(dolist (muh-cons-cell muh-alist)
(fn-on-key (car muh-cons-cell))
(fn-on-value (cdr muh-cons-cell)))

ez

also being a pedophile will spiritually inhibit you from becoming a master wizard

Stallmanbros...

>It's complicating my program so much that I wonder if I should even use cons cells.
If it helps, you should use records to hold structures.

I can't decide on a Scheme :(

Guile is a good shout

Guile

Attached: 1622383263560.png (583x146, 20.49K)

I imagine everything but Racket is a waste of time.

Posten your Init.el

(require 'package)
(add-to-list 'package-archives '("melpa" . "melpa.org/packages/") t)
'(custom-enabled-themes '(ubuntu))
'(custom-safe-themes
'("

Guile is pretty good, but I don't like how it won't be available on Windows.

Meh. Bill Gates can kiss my ass.
Libre is the way.

you should add something like
(setq custom-file "~/.emacs.d/custom.el")
so the custom stuff doesn't clutter your config

Thanks, which part(s) should be split off into the file? All of it? It's not a big deal at the moment since there's not much there, but at some point it could become cluttered like you say.

(setq auto-save-default nil
make-backup-files nil
version-control 'never
create-lockfiles nil)

(setq custom-safe-themes t) ; disable safe theme warnings

Disable droppings and silence theme warnings.

The parts added by Custom: custom-set-variables and custom-set-faces.
You should also load it after you change where custom lives.
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file)

Chez is pretty good, it has a native installer for Windows. It's also very fast. Another option is Kawa but you need JVM. If you can install Cygwin or the like, there are more options available.

>Chez
What do you do for libraries? Chez's built-in libraries are primitive.

As others have said, Evil is unironically a better Vim than Vim itself. Not convinced? Try the following in both:
i1 2 3 4 5 6 7F2vf6l:!tr ' ' '\n' | sort -r | tr '\n' ' '

But I don't want Vim. I want Emacs with Vi-style keybindings, and Evil delivers.
There is much more to Emacs than the keybindings.

is there any advantage to learning vim keybindings as a long-time emacs user?

i quite like the mnemonic-style emacs chorded keybinds as it is so i'm on the fence about it

>Learning the default keys is irrelevant.
I disagree. Some modes or extensions often use keybindings based on the default Emacs ones, usually for navigation, therefore it makes sense to at least become familiar with them. They aren't hard at all, really, since they are not modal.
However, it's true that, as you get more comfortable with Emacs and recognize common patterns in your workflow, you should automate as much as possible with Elisp and take advantage of custom bindings.

I am really surprised that key-chord is not built-in. The possibilities it opens are huge.

Why is everyone saying "HURR DURR YOU CAN PROTOTYPE SUPER FAST IN COMMON LISP"?
Is this a feature of using the REPL?
I feel like i am holding it wrong, because i keep debugging functions the way i would debug them in python

Sure you can isolate the functions and call them explicitly, but that's about all the extra things I've found
What am i doing wrong

It's a different style of development.
Starting with the data you want to transform, apply transformation, evaluate, and repeat.
It's not limited only to lisp but it really is an attractive feature of the language.

You kind of end up with a workflow where when writing a function, the input is like a seed, and you grow the code around it, evaluating often.

is this not basically TDD at the same time?

Kind of, but having a testing framework in place, especially for more complex projects, should not be neglected.
But I have found developing in this style to be incredibly intuitive and efficient.

You use the REPL + Inspector and continually modify the function until you get the behavior you want. It's 100x more productive than Python once you get used to it, especially for long-running programs, like building a web API or game as it's running.

thanks anons

Once it clicks I guarantee you will be having the most fun programming than you have had in quite a while.

can you elaborate on using the inspector? i know SLIME/SLY can do that, but i've never gotten further than inspecting the call stack (and even that was only after interrupting an infinite loop)

let's just say c-x c-e changes the game entirely
evaluation on-the-fly is based

Absolutely. I've been programming for 15 years and after familiarizing myself with this style of development, I dread having to use C ever again.

(defpackage a
(:use :cl)
(:export :vowel))

(in-package :a)

(defun vowel (sym)
(member sym '(a u i e o)))


>function does not actually work when the file is loaded in the repl

(load "a.lisp")

(a:vowel 'a)
NIL

(a:vowel 'b)
NIL


The symbols '(a u i e o) in the package are different, aren't they? Gotta export them too somehow? Well fuck this shit.

I give up on this lisp package and namespace stuff. Everything's going in a single fuckhuge main.lisp even if it gets to 50k+ loc. At least that way its somehow manageable and I'm not getting GOTCHA like the namespace recursion problem I'm looking at right now.

Something something no RSI

You could use keywords or one package in multiple files. A common convention is having one packages.lisp file for all the package definitions in the project.

HJKL is superior to BNPF in every regard except when you're using non-qwerty keyboard. Otherwise it's not really worth it.

Racket.
You can build something useful with it.

Good shout.
Maybe I'll switch when I start developing more serious injuries.
I've got a broken knuckle but my RSI seems to have improved. No doubt I'll develop more problems moving forwards though.

You don't. Scheme is a fairly minimal language (at least for now), all it provides you are essential procedures and features that cover every things you can imagine. What you can do via libraries, you can do the same using everything in a Scheme standard.
What I said was a cope, btw. Scheme ecosystem *is* shit. It's called the most unportable language for reasons. Guess what, nobody want to write a library for multiple implementations, each with its own quirks and flaws. If you want libraries you better use Racket (btw, it doesn't even call itself a scheme implementation anymore) or, say, Chicken, or each implementation's FFI. Scheme, a language, not an implantation, is shit to do anything practical with.

>They aren't hard at all, really, since they are not modal.
That makes them harder.
First thing I do when I get a package is remap all the keys not covered by evil collection (which is most packages nowadays anyway).

No. XFK is the most efficientâ„¢ keybinding for Emacs. Vim isn't that good, it's just popular.
The point is, your code isn't a dead tree on the source files. It's alive in REPL, you can toy around with it easier and faster than code-compile-debug-repeat style. Giving a good and powerful REPL experience is one of the strongest point of (Common) Lisp.

Hey, is it normal that on every buffer emacs will create empty space until the last element is outside of the screen?
See pic for an example of what I mean. What you see is the dashboard and on the top of the buffer it's the random phrase that you see at the bottom of the dashboard.
Look at the scrollbar, I was able to scroll all the way down even though it's useless space, just because this last element of the dashboard is still not out of the screen.
Is this normal? Desirable? Can I change this and set it so that it will only create space for what I'm using?

Attached: dashboard28.png (1847x1001, 21.5K)

How did you scroll down? scroll-up-command can behave like your post but moving around normally shouldn't involve that command. You can C-h l to see a list of recent commands you used.

What do you mean? I just went to my dashboard and scrolled down with the scroll wheel.
It shows a whole bunch of stuff like in my commands with next to it "mwheel-scroll"

scroll-up-command is one of the commands you can use to move around. It can scroll over the "edge" like you're seeing. I also have this behavior for the mouse wheel. You can bind other function to the mouse wheel if you don't want this.

Lmao should have used Clojure if you want generic programming

>Is this normal?
Yes. It's just filler space so you can scroll beyond the last line.
>Desirable?
Maybe. Vim and Acme have the same behavior.

I'm not interested in Java. It was just a demonstration, user was asking why it isn't possible to map over cons cells, which seems useless regardless.

But I have the impression it's not even going beyond the edge per se, but just moving the edge further away by default. When I go on any page, by looking at the scrollbar I see that it has a lot of empty space I can go to, look at the screen for example.
And when I try to scroll up it's not doing anything, it's always at the bottom that there is added empty space until the last element is at the top or out of sight.
Ok so you confirm it's normal then. hmm, ok.
If everyone has this then maybe I shouldn't touch that. and leave it alone.

Attached: help28.png (1851x307, 47.67K)

Seems the scroll bar is fucked for some reason. Add (scroll-bar-mode -1) to your init.el to fix it.

How is it fucked up? It looks normal.
>(scroll-bar-mode -1)
Some people like the scroll-bar.

Attached: 2020-06-14_emacs_scrot.png (681x638, 1.25M)

>How is it fucked up?
It shouldn't count the empty space below the last line, no? People can get confused by that.
>Some people like the scroll-bar.
But you won't have a problem with the scroll bar if you don't have the scroll bar.

based

Attached: 1642516627187.jpg (1024x890, 194.13K)

No, the scrollbar isn't the problem but it's an indicator to the fact that empty useless space is already present down there.
On another note, I tried to get rid of my scrollbar but all the replacement packages that could work as useful indicators for the modeline to show me my position in a document were fucked and went outside of their boundaries, sometimes for...reasons that still go beyond me, and other times I feel like it was because of that useless space I'm talking about.
That's why I thought there could be something wrong with the way emacs loads buffers. Still not sure it's normal even though user above said it was.

Thanks for the suggestions Anons. I was hesitant with Racket because I read its interactive experience was really poor, but I'll jump into it anyways.

Common Lisp or Scheme first? I can't decide.

Attached: 1643379629811.jpg (1194x834, 111.25K)

What do you want to learn?

I've started to realize that I barely use emacs features to justify how I'm using it. The only things I regularly use is 'dired' and the base editor. I'm thinking about just switching to 'mg', 'tmux' but I'm not sure what will replace 'dired'.

I don't know. More interested in learning theory and stuff and I started SICP but I would be interested in CL since it seems it's actually used in the "real world".

Yeah, Scheme is good for learning, but CL is good for doing real stuff. Since you are reading SICP, you shouldn't mind CL for now. Switching from Scheme to CL is kinda easy if you want to try it out later.
SICP isn't a Scheme book BTW.

Yes Yes Yes

Guys I need help, I have org files saved and tagged with
#+filetags: tag1:tag2

If i want to convert every file tagged with "tag1" for example with org-latex-export-to-pdf
How can I do it?

I tried grepping tags via shell and send the filenames to emacs --batch but my files do have special links that works only if my .emacs is loaded.
When using M-x org-latex-export-to-pdf it works in my session

Clojure is used more than either in real world work. But Common Lisp is closer to the "proper lisp" Platonic ideal than either.

Use the -l option?

What's a good scheme book? Isn't Racket based on scheme and SICP use a diaper of scheme? Thanks for the rec though.

Goddman phone poster I am
*dialect

yes but I wanted to do it with elisp

Ok new problem arise, if I do org-latex-ec..-pdf
from within emacs I get a pdf with all the contents while from the command line i get a void pdf with just the word "contents"

SICP uses plain Scheme with a handful of built-ins that are in MIT-Scheme. Racket is a dialect that diverged from Scheme a while ago.
>What's a good scheme book?
The OP lists scheme.com/tspl4/ as one of the recommended Scheme books. I recommend "The Little Schemer" instead if you're new to Lisp.

The best one is the Scheme standard + your implementation manual. This is the most "practical" Scheme you can get.
However, there are a few good Scheme books to learn the language (and CS ideas in general) like the little Schemer (and the books in the series), sketchy Lisp, the Scheme programming (3rd edition for R5RS, 4th edition for R6RS). Algorithms for Functional Programming looks good, too, but I haven't read it yet. As well as Software Design for Flexibility and htdp.org/ that look like SICP-lite as far as I heard.
Racket was Scheme, but it's basically its own language now.

What about Let Over Lambda and On Lisp? Jewgle recommended these books to me as I was fishing for some info on macros.

they're both great. read "On Lisp" first, and you might need to spend some time with it before reading "Let Over Lambda", which is also great, but also completely insane.

They are good, but you should really have a good understanding of the basic before you get serious with CL macro.

ranger/nnn/midnight commander?

Thanks for the recs user!

Emacs is much comfier to program

Best resources for learning to implement Scheme reader?

Attached: Fumami_Yui_Holding_SICP-6faa42a3af4939945c5eece1f659f92b.png (873x1079, 928.71K)

Clisp

Thanks gentelmen.

why? mg sucks

>but I'm not sure what will replace 'dired'.
I would take the time to learn ranger.
github.com/ranger/ranger
ranger.github.io/

>I was hesitant with Racket because I read its interactive experience was really poor, but I'll jump into it anyways.
This looks like a good enough interactive experience to me:
youtube.com/watch?v=AXJ9tTVGDwU
Racket has a great documentation culture too.
Everyone is encouraged to write their docs in scribl, and
there's a lot of infrastructure in place to make it look clean and readable and widely accessible.
docs.racket-lang.org/gui-easy/index.html

What's the point in switching away?
There is an effort cost to changing your habits, and then you loose the upgrade path that emacs offers if you did want one of those features.
I guess if you really can't afford the 100MB that emacs takes up then it is worth it, but that really isn't much storage at all.

lispchuds... d-did we get too cocky?

most evil users eventually learn the emacs defaults, but just choose to stick with evil because it's comfier

Emacs keybindings are perfect and are necessary for the flow. It doesn't need more than a little tweaking at most.
Get out of here and make your own general, this is for the emacs chads you fucking tourists.

Don't download Chinese package.
Simple as.

based

>Emacs keybindings are perfect
They're pretty bad and hard on your hands and wrists.
Only org-mode has decent and intuitive default keybindings.
Vi keybindings make emacs tolerable.

>is there any advantage to learning vim keybindings as a long-time emacs user?
None. Use Emacs with vanilla keybindings, as RMS/God intended.

>They're pretty bad and hard on your hands and wrists.
Map ctrl to caps lock. Zero RSI after that.

mg is based

what makes org different? most mode specific keybindings are mnemonic

No nigger.

caps esc
alt ctrl

Use thumbs for ctrl like God meant us to.

if you're running a nice split keyboard with thumb modifiers, yeah, emacs default keybinds work. but sometimes you're on a laptop keyboard and it's clear that evil-mode and god-mode just provide a better user experience for accessing that functionality.

kys troon

M-enter is an ergonomic way to start a header.
M-$arrowkey keeps your hands close to where M-enter is and is an intuitive way to do structural operations.
TAB cycling on headers is intuitive.

The main operations don't require difficult chords, and they're intuitive. I think this part of org-mode is well designed. It feels fast.

No
Yes, thats what I do
If you're typing with a laptop keyboard, evil or not, old thinkpad or not, you're doomed to have problems. I still have a normal keyboard but yeah I'm planning to go for a personalized split keyboard.

>Map ctrl to caps lock. Zero RSI after that.
I don't think mapping one of the most used keys to your pinky is a great way to avoid RSI.

your fingers rest naturally on home row. caps lock is on the home row.

extending your pinky slightly to the left of the A key is way better than stretching it out and down below the shift.

>I still have a normal keyboard but yeah I'm planning to go for a personalized split keyboard
I recommend the lily58, it's really nice for emacs. I still use evil-mode because modifiers still aren't as comfy as full-on modal editing and keep god-mode around for when I'm on an airplane and typing on my laptop's keyboard, though.

Attached: img_20200921_172028_01.jpg (4032x2428, 3.78M)

Looks good.
There's so many keyboards on the market, so I feel a little lost.
I guess you say it's good for emacs because of the placement of the alt, ctrl, super keys, they definitely look practical (although I'd have put them closer to the middle, considering I want to have as easy an acces to them with my thumbs as possible)

it's fully programmable, you solder it together and program/build/upload the firmware for it yourself with qmk firmware, so really the thumb keys are whatever you want them to be.

pic related isn't mine, I use a layout that's much closer to symmetrical

stop using QWERTY

nah, I mainly built the split just for postural reasons and I already can work with both vi and emacs keybindings comfortably, that's as deep as I'm going to go and no heatmap is going to convince me otherwise

fair enough user, and yes, the split is comfy

erichgrunewald.com/posts/how-bad-is-qwerty-really-a-review-of-the-literature-such-as-it-is/
>Assuming a person [types] 1,000 words a day, typing will solely take about 15 minutes a day. If that person can save 10% of typing time by changing to Dvorak, he or she can save 1.5 minutes a day, 45 minutes a month, and finally 9 hours a year. It means this time saving might be overwhelmed by the cost of changing the layout.[33]

>How much time do we actually spend typing? Xah Lee logged his keyboard use for two years and found that he typed roughly one hour per day (assuming 50 words per minute). Now, that is likely an underestimate as it only records the stuff he wrote in Emacs, but he also reports spending 13 hours a day in front of the computer, much of it likely in Emacs. Most people probably type significantly less. A 5% improvement for Xah Lee would save him around 18 hours per year, which is not bad, but also the upper end of what one might expect.
It's likely that the amount of time you'd save typing wouldn't exceed the amount of time you spent learning Dvorak

I learned Colemak for the comfort and ergonomics, not necessarily the speed

1,000 words a day is really low, and the discussion is not about speed, it's about ergonomics and reducing strain

Does anyone here use trivial match for common lisp?
How would you bind a part of a pattern to a variable?
(match x
((list (type symbol) ))

How would I return the symbol?

How’s parenscript? Can I make single page applications with it or is it too immature?

Tell me about the pondering mage
Why does he keep getting posted

The pinky, the most shitty finger in existence, is already responsible for pressing more buttons than most other fingers since it is on the outside of the hand. Assigning even more work to it is a questionable idea.
Of course, these things are very individual. The good thing is that you can try things out, and you have plenty of time to adjust if you feel pain appearing in some part of your hand.
Kinesis Advantage 2 is a very good keyboard.

Oh and to be clear, if there is an assumption here that you press the ctrl key with your pinky (which you seem to do, when I read your post again), then sure. But it's not a solution to the fundamental problem of the pinky being a piece of trash.

it's a nice image

how to make experience with sdl2 in common lisp more pleasant? I mean, every time I fuck up something I need to restart repl. For example: I forgot to handle "x" click to close window, now if I just call (sb-thread:destroy-thread ...) the window will close just fine but I'll not be able to open another one until I call (sly-restart-inferior-lisp) and reinitialize everything again.

Take a look at how sketch does it
You can close the window there without killing the sdl2 loop
Can't give more details because i have no clue about internals there

Is LISP any good for handling strings? Today I was trying to come up with an algorithm for finding the best first guess on the game "wordle", and the Python program for that turned out pretty ugly and slow.

>the Python program for that turned out pretty ugly and slow
let's see it

About as good as any other language, except the standard string library needs to be imported.

Is the kinesis advantage 2 really adapted for emacs?
Seems to me like alt and ctrl placements are a little bit too far away to push it with the thumb quickly. Appart from that it seems great ergonomically.

vimtard here, how tf do i visit a new vile with doom emacs? managed to open a scratch buffer somehow, but inadvertently closed it

>vile
file ofc

(setq eshell-cp-interactive-query t)

Attached: 1633194720215.jpg (224x325, 15.93K)

Qutebrowser chads: c.editor.command = ["emacsclient", "-c", "{file}"]

by default in insert mode press ctrl+e for an editor, it'll spawn a emacs window.
pic related for those with a ZSA moonlader: set this to the thumb cluster middle key and it's so comfy for emacs

Attached: file.png (147x77, 2.75K)

M-x find-file
I don't know what key does doom bind the function to.

I don't use DOOM, but :e should work like vim

M-x file shows me what's available at least, but find-file seems predicated on there already being one written to disk.
lol thx that works. Probably why I decoded on doom in the first place

>find-file seems predicated on there already being one written to disk.
You can type the filename that you want to create and you'll get one. The file won't really exist unitl you save the buffer.

Hmm, when I press RET, it prefaces the filename I entered with (match-required)

Weird. All the minibuffer completion that doorm has should work ootb.

Well it says "Edit file FILENAME", and there's one called find-file-existing, which says "Edit the existing file FILENAME", so I don't see why it doesn't work for me. Ah well

It's mature enough for the Nyxt browser.

>the best first guess on the game "worldle"
You're using an established string similiarity algorythm with a sort, right? Right?

>shortdoc
based

Why don't I see AOMP or Let Over Lambda shilled here? They're some of the best Lisp books out there.

Attached: homu.png (2044x2592, 2.43M)

>AOMP
What is this?

Art of Male Penetration

The Art of the Metaobject Protocol

Attached: 9780262610742.jpg (1536x1988, 1021.45K)

That's Saruman gazing into a palantir, so it implies that Emacs is a surveillance tool.

Emacs has built-in keylogger, so...

Can't you use macro to make your codes very fast?
By pre-computing most things at compile-time.

Attached: c01.jpg (535x767, 78.46K)

You can. Actually, a good compiler, Lisp or other langauge, will do that as much as it can.

Which style of macros is easiest to add to a simple Lisp?

Common Lisp/Emacs Lisp style macros.

I can't decide between Common Lisp, Racket and Clojure can someone give me any advice?
I like CL because it's the most "lisp" lisp that I've seen so far and also because it has a standard which basically guarantees that my programs will still work in a few years.
I also like CL because it allows for more "bare-metal" programming compared to something like Clojure which relies on the JVM.
I like Racket because it has a better standard library compared to CL.
I dislike Racket because it has a gimped REPL compared to CL.
I like Clojure for the same reason I like Racket.
I dislike Clojure because it most of the times relies on the JVM.
I also dislike Clojure because its REPL while better than Racket's is still worse than the one you get with CL.
I'd just wish that CL could have a good GUI library like Racket does and that it would be as portable and widely used as Clojure without having to subscribe to the JVM (I just want to make software for Desktops and for Phones).

SPC-.

Nothing wrong with JVM. It's well-tested and generally good runtime. You don't have to choose one and discard the others, use the appropriate tool for the problem you are trying to solve.

>(I just want to make software for Desktops and for Phones).
You're only choice is Clojure and his pal ClojureScript.

They look like advanced Lisp books that require some pre-reading.
There's enough good Lisp books out there to make a reading chart out of them.

uhh.. tried "SPC .", and it gave me a dialogue where i could find file. entered a new filename but it didn't work. then i tried "SPC - ." and it said dired down in the right corner, and appears to have opened a buffer with the contents of "ls -l", and now it's stuck burning 100% cpu
>WTF

To create a new file: SPC b N to open an empty buffer, SPC f S to save it

It works great, ctrl and alt are in very comfortable positions. It takes a few days to get used to.

Is there like a reference to the library functions available in elisp? For starters it took me an undue amount of searching to figure out that print was called prin1

Thanks for exactly answering my question!

user maybe already gave you a satisfactory answer, but a theory about what might have happened: When you press SPC-., you will search through all files in the current directory. If there is a match when you press enter, that file will be opened. In your case, that file might have been a directory, and you subsequently opened the directory.
What you want to do is enter SPC-., type the file name you want, then press C-k. This goes up one step in a list, and will select the text you entered (and therefore create a new file), rather than one of the existing suggestions.

Wow, that worked, and it even provided scaffolding comments and stuff

Couldn't you technically use CFFI and target the android NDK in CL?

What the actual fuck!? I somehow overwrote the file I was editing with this nonsense:
nvm can't even copy it

something about debugger entered--Lisp error_ (void-variable w)
so i tried to write and it overwrote the file with the contents of an error message about it not understanding what i meant by write.. oh joy

This is a fundamental feature of emacs to make sure you're committing at least once every 30 seconsd.

Ok, does that mean there's a way to restore the contents I overwrote?

Now I'm worried that you think I was serious.

Oh.. Look I didn't even know how to open a new fucking file with emacs a earlier itt

I don't understand what you are talking about. So you are editing a file, type "nvm can't even copy it" and get an error? Can you post a gif or a detailed step-by-step of what you are doing?

No worries, I'm just fucking with you. I have no idea what could have caused you to overwrite your entire buffer like that. Usually if you encounter an error, it would just exit the current function and no harm done.

Read what he said.
The error message opened in a new buffer and while he was in that buffer he saved it to his file

Thanks for trying to understand my issue. I was editing file "a.el", wrote some elisp, tested it and so on, then decided to write it. Apparently I must have done something wrong, because I got an error message about w being a void variable, when I did "ESC :w RET". Furthermore, I somehow wrote that error message to to "a.el", and now while trying to copy it into my browser, I figured out I can't even copy. Did right click like 3 times after selecting everything, and now all the text is gone, but the clipboard is filled with something I copied earlier, even though I evaluated "(setq x-select-enable-clipboard t)".
I don't even..

Ok, so there's a bit of a learning curve to this. No way of restoring what I saved to that file before, I presume?

Did you close the buffer where the file was opened in the first place?
You really should be running git anyways, or have other forms of backups.

I somehow crashed emacs. Is there a swap file like with vim?It's not that big of a deal really, just some basic hello and 1+1 stuff, but I'm amazed as to how alien this editor is to me

>w being a void variable
>ESC :w RET
Does the code you tested have `w' as a variable? If it doesn't then I think it's Evil's issue.
> I somehow wrote that error message to to "a.el",
That's a problem since we can't know what exactly did you do. But Emacs can undo things just fine. Better yet, there is a package called `undo-tree` that can visualize a change in a buffer in a tree graph.
>I can't even copy
I don't know what does Evil used to copy, but you can always call M-x copy-region-as-kill to copy it.
>Did right click like 3 times after selecting everything, and now all the text is gone
I think that's the default behavior. My Emacs also acts like that, double right click, to be precise.
Since you are new, I recommend Xah's tutorial. It helped me a lot when I started using Emacs xahlee.info/emacs/emacs/emacs.html
There is an automatically backup feature but I don't know whether doom enables it by default or not. gnu.org/software/emacs/manual/html_node/emacs/Backup.html

I just installed Emacs and tried Witchmacs. I like vi keybindings for editing text, but evil mode seems to ruin stuff like dired or info. Is there a way to disable evil mode when entering dired or info?

>Does the code you tested have `w' as a variable?
No.
>Evil issue
Maybe, but it's more likely I pressed something wrong.
>That's a problem since we can't know what exactly did you do.
This user summed it up. >My Emacs also acts like that, double right click, to be precise.
Ok. I don't think it's worth the hassle to try and restore a few lines of babbys first elisp. I'm skimming through gnu.org/software/emacs/manual/pdf/eintr.pdf but I'll check out that tutorial as well

You can add a function to the mode's hook to disable Evil.
(add-hook 'dired-mode-hook '#(lambda () (evil-mode -1)))
(add-hook 'Info-mode-hook '#(lambda () (evil-mode -1)))
The (evil-mode -1) is a place holder but that's more or less a stardard way to disable a mode (I don't use Evil.)
That book is a book to learn Elisp, not really a book to learn how to use Emacs. It's a good book regardless, you can read it in Emacs. C-h i and search for Emacs Lisp Intro. You'll get an interactive experience this way. For example, you can move a cursor to the end of an s-experssion, press C-x e, and you'll get see the result in real-time. It's great fun to learn Elisp from within Emacs.

1. (evil-set-initial-state 'MODE 'emacs)
2. Have you tried using evil-collection to get evil bindings in other modes?

oh ffs.. Please, can you tell me how to switch between a buffer, frame whatever it's called, where I have the file I'm testing stuff in, and a another one underneath, where I have the manual? C-x b lets me select a different buffer in the current window, but while C- (or right) let me switch from the info buffer, I can't figure out how to get back to i

Meant C-x or C-x , but that doesn't work for the *info* buffer. C-x o also lets me switch from it, but not to it

Think of info buffer as its own webpage. You can switch between buffer, but you can't use the same command to switch between info page because, well, it's the same buffer. I don't use info that much but I think u and/or b will bring you back to the previous info page (it's call a node). You can also use mouse to navigate info, just click on the navigation buttons on the top of an info page.

Oh, I can just click it. Wait, so the info page is not its own buffer? Is there a keybinding to switch focus from the info page to the buffer I'm editing? If I have to use the mouse, I may as well use the browser.

>the info page is not its own buffer
It is a buffer. Did I make you confuse?
>Is there a keybinding to switch focus from the info page to the buffer I'm editing
You can do that like you do to buffers.

Hello guys, just wondering if any of you actually use xah-fly-keys for emacs. Do you think they're worth the switch from evil?

I do. Try it out and judge for yourself. I like XFK because vim movement is fucked on Dvorak keyboard. The keybind is fine, you got somewhat essential and often-used functions nicely grouped together. The small helper functions he wrote are handy too.

>You can do that like you do to buffers.
But I can't. Opening another buffer with C-x 2 lets me do C-x o to switch between it and the first buffer, but I can't switch to the info page. Switching to the second buffer, then doing C-x b and selecting *info*, then ESC to close the info page works, but it makes me think the info that pops up when doing C-h RET is not a buffer in its own right.

Thanks
>2. Have you tried using evil-collection to get evil bindings in other modes?
I don’t feel like its worth it and I’m already
used to info keybindings from using the info program. I just like vi keybindings for writing text.

Hmm, the bottom line moves up above it, so I'm thinking it's the minibuffer, and that doesn't get treated like an ordinary buffer. Does that make sense?

I see what you are doing now. C-x 2 will split your Emacs's windows. So you can switching between the two using C-x o. That's all it does. You have 2 "area" for buffers. You can switch between these 2 areas but to switch to the other, background buffers, you have to C-x b to choose which one do you want to use. Does this make it clear?

Yes, but can I resize the areas like in tmux?

Of course. emacswiki.org/emacs/WindowResize
The default keybindings are hard to use but you can rebind them or use a mouse if you like.

Oh, found my way there just before you posted that link. Default keybindings area indeed a bit clumsy. Thanks, ought to be able to figure out a bit more now.

Emacs can't find my ghcup stuff. On installation, it added this to .bashrc:
[ -f "/home/user/.ghcup/env" ] && source "/home/user/.ghcup/env" # ghcup-env

How do I get emacs to understand it as well?

In general, you should really be setting your environment variables in your ~/.profile, so that all your programs have access to them.
You could workaround this for now by opening emacs in the shell with emacs & + disowning it.

Thanks! Why can't I just add it to .profile? I tried now and didn't work.

Replace "source" with "."
If that doesn't work it's something to do with ghcup.

lisp is the most powerful programming langu-

Oh, or you haven't logged out and logged back in. Your ~/.profile is read once when you first login.

And you can drag the figures to use them as arguments to functions. Mathematica is wild.

ah, I see. Thank you!

>my lang has so and so builtin
>yours is dead
Do you even have subseq?

Like this? reference.wolfram.com/language/ref/Subsequences.html

Sorry if this is a dumb question, I'm currently trying to install yukimacs at the moment, but after setting everything up, it ends up looking like this, does anybody know what exactly I messed up?

Attached: file.png (1188x778, 197.23K)

Font issue?

maybe yuki is modifying your config while you aren't looking

Sorry for the tech support, by the way, I'm just pretty new to this and don't know how exactly to go about tackling this.
Looks like it. What font does yukimacs use?
Well, how could I check/fix that?

Attached: file.png (1208x787, 7.29K)

reach the end sky

No, like this:
clhs.lisp.se/Body/f_subseq.htm
It returns the values of a sequence between two bounds, and allows those values to be set to a new sequence in the original via SETF.

What's your preferred font? I just use dejavu sans mono

>What font does yukimacs use?
user, it's literally on the first thing you see on readme.
Iosevka.

Sorry bro we don't support yukimacs here.
Witchmacs is the canonical configuration.

Attached: Screen Shot 2022-01-29 at 19.40.30.png (561x172, 22.94K)

Start emacs with emacs --debug-init

Whats the appeal? Tall and thin so you can violate the 80 char per line convention even further? I do not approve

More code on screen.
>80 char per line
I use 120 characters per line. Fuck boomer limit.

Agave. It has a funny windows rendering issue with emacs.

Unbased and cyanpilled

reference.wolfram.com/language/ref/Part.html

doom/evil is so convoluted, specially for beginners. none of this would have been an issue on vanilla emacs

Doesn't look like you can do:
x[[1 ;; 2]] = {1, 2}

Go to scope -> assignment in the docs, you can.

Attached: PART.png (592x319, 26.96K)

Thanks, I got it to work now. Sorry for being a retard.

Attached: file.png (1920x1080, 158.65K)

Make sure to check out chez-srfi though, as well as all the Scheme packages that work on every platform (match, irregex, SXML, etc.) Match is essential for every Scheme program in my opinion. chez-srfi implements 66 SRFIs for Chez Scheme, which adds up to a whopping 67 thousand lines of code. Chez itself is also about 20-30% faster than SBCL for all but floating-point calculation purposes

cliki.net/GUI
Most of these are abandoned, but the ECL Qt binding seems pretty fresh. Wrapping GTK shouldn't be that hard, either. ABCL is another option for desktop systems and lets you use SWING/JavaFX or whatever. On phones it's more tricky. There you will probably have to use their native tooling for the GUI and call into/back from the Lisp core logic. On Android ABCL might work, otherwise ECL is probably the best bet. In that case you might even get away with using QML. Dunno about iOS.
Anyway, Portable GUI is a hard problem no matter the language, especially if you also add phones into the mix. Still, CL is available anywhere and depending on what exactly you're looking for or where you're willing to compromise there's no reason it wouldn't work for GUI desktop software.

OK so basically I want to indent a bunch of lines by two spaces, how do I do this?
This is something custom, outside of auto-indent.

Nevermind I found it it was c-x tab

there's this restart in common lisp:
>[ABORT] abort thread (#THREAD "repl-thread"...
is it possible to add handler or something to change it's behavior?

I think it's easier with ECL, but either option means getting dirty with C.

People managed to target the PS2 using a custom lisp written in CL
github.com/water111/jak-project
So I believe that you can definitely target any platform you want to using CL (even if that means writing your own Lisp, which isn't that hard).

in evil mode, do you guys bind esc to something else?

i bind esc to caps lock. much comfier

common lisp is an uphill battle, any time you need anything third-party you'll have trouble. it's just not a mainstream language and, even though it technically "can do anything", most of the time it just isn't very practical

clojure is the opposite, it's the only lisp that's a relatively mainstream and modern language, so you'll have a lot more support from the community, but I personally dislike the language itself. it seems to be obsessed with functional programming the same way haskell is, and that's not very lispy. I never got very deep into it so I might be wrong, but from the outside it seems too restrictive compared to the other big two

again, personal opinion, but I think the only context where you can freely use lisp nowadays is for your own personal stuff. there's no incentive to use anything but clojure for a project you want to deploy somewhere else, and clojure doesn't feel good as the others.

Sorry for the dumb question but how do you rebind evil mode kebinds?
I want to change insert mode to caps lock

Attached: 1642956832988.jpg (780x1010, 344.04K)

>chez-srfi
Thanks, never heard of this.
>match, irregex, SXML, etc.
What are these? chez-srfi don't seem to have them.

You can't bind caps lock through emacs. Does swapping caps lock with escape work for you?
setxkbmap -option caps:swapescape

I really don't understand how emacs can increase productivity/better workflow. I look at it and I'm not trying to hate I would like to use it but I just really dont 'get' it

I came to emacs to basically just use it as a better vim. I've found the plugins are much easier to set up and work better, and unlike other editors, the vim bindings here (evil mode) actually work and I don't feel like a second class citizen while using them. I only wish it wasn't so slow. The difference between it and vim is definitely noticeable. Compiling the latest version myself makes it way better, but the other day I tried updating it and kept getting weird errors when opening it, so I ended up going back to emacs 27 and it's slow again and im sad :(
Oh well though, I'll just try again next update.

Integrability and extensibility. You can do all your work in Emacs, they together form a single, unified workflow in one program. You can extend Emacs to work the way you want, bending it to suit your own workflow. The result is a comfy working environment for you, from you. Note taking, tracking your TODO list, version control, coding, building, running, terminal emulator, reading the docs, etc. can be done inside Emacs. The meme of called Emacs an OS comes from this scenario, you want to live in Emacs because everything fit so well together, they are all work the exact way you want them to work. Compare to the chaos, program-specific quirks and flaws, each with its own behavior and keybindind (if any) of non-Emacs workflow, Emacs is like a safe heaven for your soul.

Is there a way to add elisp code completion to eval-expression (M-:) in the minibuffer?

it's there by default, press TAB or C-M-i

Unironically try microsoft's code editor, it's the pinnacle of productivity since it can have vim keybinds, all the extensions you would ever need for doing the job, and the support of the most popular product in its field, of the standard. Don't fall for the meme you don't 'get'.

>some EMMS variables literally don't work unless you use customize
what? how does this work?

any examples?

set emms-player-mpv-update-metadata to t, then try listening to internet radio. the metadata won't update. it only works if you use custom-set-variable.

I use Vim but, there is:
github.com/hlissner/doom-emacs

Custom isn't just a prettier UI for setting variables. It didn't work because setting the variable directly doesn't run the custom variable's setter.
git.savannah.gnu.org/cgit/emms.git/tree/emms-player-mpv.el?h=9#n149
I think you could also try setting the variable before loading EMMS.

(define (total-file-size file-name)
"Return the size in bytes of the files under FILE-NAME (similar
to `du --apparent-size' with GNU Coreutils.)"

(define (enter? name stat result)
;; Skip version control directories.
(not (member (basename name) '(".git" ".svn" "CVS"))))
(define (leaf name stat result)
;; Return RESULT plus the size of the file at NAME.
(+ result (stat:size stat)))

;; Count zero bytes for directories.
(define (down name stat result) result)
(define (up name stat result) result)

;; Likewise for skipped directories.
(define (skip name stat result) result)

;; Ignore unreadable files/directories but warn the user.
(define (error name stat errno result)
(format (current-error-port) "warning: ~a: ~a~%"
name (strerror errno))
result)

(file-system-fold enter? leaf down up skip error
0 ; initial counter is zero bytes
file-name))

lisped

Does anyone know how to disable evil mode for tetris specifically? I'm tired of manually entering INSERT whenever I restart tetris.

Witchmacs is 3 years out of date.
Yukimacs is the closest we have to a spiritual successor.

Attached: file.png (947x1200, 834.15K)

(evil-set-initial-state 'tetris-mode 'emacs)

It has a few things going for it:
-most of the extensions are easy to set up, once you know elisp
-there are enough of said extensions to do almost anything you want, and they tend to be of an excellent quality (magit for instance is the best git interface out there, org/-roam is superlative for note taking and time management)
-you can automate almost anything you want and bind it to a key through elisp
-it's portable to almost any operating system, so you only need to download one piece of software to have your entire dev environment up and running

There are only really two things that I don't like about it:
-elisp needs a few things to be as good as other lisps (set lexical binding)
-it's slow and single threaded (only a problem in certain modes, but it can get quite bad)