Fork me on GitHub

I asked a variant of this before but can’t find the answer… is there any shortcut (paredit or otherwise) that will prepend the discard symbol #_ to a form the pointer is in?


With smart-parens:

(defun discard-form ()
    (insert "#_")))


or you could use paredit-backward-up if you use paredit


folks, the command you're looking for already exists in clojure-mode. it's clojure-toggle-ignore

metal 2

Ah, nice! Much simpler


Regardless of what already exists, I think it is a good idea to learn some basic emacs lisp in order to start the journey of improving your own editor.


What do you mean by "it is a good idea"? I'd put it differently. It's a requirement. You don't say: "it's a good idea to learn how to be calm and control your body to learn aikido..." - that's the whole purpose of it. Emacs is like aikido - the whole purpose of it is to run Lisp. And as you said - it's a journey, just like with aikido, there's no "completion", you just keep learning it.


I feel like the grasshopper who has not yet snatched the pebble


I am a grasshopper who has not grasped the pebble.


I appreciate all the answers… what exists already and also examples of how to do it myself. Both are great. Thank you all!


I didn’t find clojure-toggle-ignore as an option in my Emacs; I found this online, too:


I’ll try @UE1N3HAJH’s code… I’m not sure actually how to make that something I can run with a binding… diving into the init.el… send help if I’m not back in five days.


It was added in Feb 2021, so you may need to upgrade your clojure-mode package if it's older than that. If you want to stick with my code (whose behaviour is different, and may be what you prefer) or some code that you write, running with a binding would simply look like:

(define-key clojure-mode-map (kbd "C-#") #'discard-form)


another weekend where I'm going to try to have a working and shareable emacs config that plays well with nix (and includes things like org-roam, evil, emacs 29, pdf-tools)

👍 2

i've also been fully trying to convert to nix this weekend (with mixed results so far)


nix: not even once

😂 1

It doesn't mix well with emacs, the nix version of Emacs has always been plagued with random issues that packaged versions just don't have. It's nice for .files until I move it to guix home though


I wish guix worked on macOS

upvote 1

I'm testing switching from lsp-mode to eglot - so far so good, but one thing I'm missing is code action for adding requires to the namespace macro - is that not supported by eglot or something?


maybe Eric @ #CPABC1H61 knows this sort of thing well?


Yeah, i figured it's better to ask here first since it's more related to Emacs, but I'll there, thanks!